Este problema me ha estado molestando por un tiempo.
De vez en cuando, necesito escribir un archivo de script que ejecute sudocomandos. No necesariamente sé de antemano que voy a ejecutar, sudoasí que estoy seguro de que hay una manera de abrir una interfaz gráfica agradable (como la que aparece al instalar el software), pero ¿cómo?
El man sudodice:
-A Normally, if sudo requires a password, it will read it from the current 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, the value specified by the askpass option in
sudoers(5) is used
Así que estoy bastante seguro de que la solución reside en eso -Ay SUDO_ASKPASStupla, sin embargo, he logrado encontrar qué poner en eso.
gtksudookdesudo. No sé qué hay en el lado de OS-X de las cosas, pero supongo que estás buscando algo en ese sentido.