İçin -A, --askpassseçenekler yardımıyla GUI istemi aracılığıyla şifre isteyebilirsiniz sudo.
Gönderen sudoman:
-A, --askpass
Normally, if sudo requires a password, it will read it from the user's terminal. If the -A
(askpass) option is specified, a (possibly graphical) helper program is executed to read the user's
password and output the password to the standard output. If the SUDO_ASKPASS environment variable
is set, it specifies the path to the helper program. Otherwise, if sudo.conf(5) contains a line
specifying the askpass program, that value will be used. For example:
# Path to askpass helper program
Path askpass /usr/X11R6/bin/ssh-askpass
If no askpass program is available, sudo will exit with an error.
Yani, örneğin, grafik yardımcı programını can ssh-askpasshangi bir geçiş ifade için kullanıcıya sorar GNOME kullanarak:
$ which ssh-askpass
/usr/bin/ssh-askpass
Yani, aşağıdaki satırı ekleyin /etc/sudo.conf:
# Path to askpass helper program
Path askpass /usr/bin/ssh-askpass
Ve GUI şifre istemini bulacaksınız:

Bunun gibi başka bir program da kullanabilirsiniz zenity. Aşağıdaki örnek kullanın:
$ cat /etc/sudo.conf
# Path to askpass helper program
Path askpass /usr/local/bin/zenity_passphrase
Doğrudan komut olarak kullanılacak zenity_passphraseözel bir komut dosyası nerede ayarlanır :
$ cat $(which zenity_passphrase)
#!/bin/bash
zenity --password --title="sudo password prompt" --timeout=10
Hangi gibi çalışır:

Not:
Ayrıca kullanabilirsiniz gksudoyerine (GTK + önyüzü Su ve sudo için) sudoGUI istemi ile sorar komut ( gksuve gksudoeskimiş ve 2019-2020 mali yılında terk şunlardır):

Ayrıca pkexec( polkit uygulaması) bazı uygulamalarla / komutlarla (diğerleri için yapılandırılması gerekir) kullanabilirsiniz:

pkexec leafpad, o verirCannot open display:şifrelerini girdikten sonra. Herhangi bir ek yapılandırma gerekli mi?