Originally posted by oshunluvr
View Post
I thought that sudo -S would reveal the password via the ps command, but because echo is a shell built-in there is no process whose command line is the echo.
Rather than sudo -S, I think sudo --askpass is nicer. AFAICT sudo -A needs a one word command, though, but refactoring your scripts to use a common password script can be seen as good. Say a script called askforsudo in your bin directory:
Code:
#!/bin/bash kdialog --password 'This task requires SUDO access. Enter your password: '
Code:
export SUDO_ASKPASS=~/bin/askforsudo sudo --askpass [i]whatever[/i] sudo --askpass [i]whatever else[/i]
Judicious use of sudo -k might be good, too.
Comment