Re: sudo in terminal
Re: sudo in terminal
- Subject: Re: sudo in terminal
- From: garbanzito <email@hidden>
- Date: Sat, 6 Oct 2001 19:37:00 -0600
at 2001 10 06, 13:58 -0700, they whom i call Brad Giesbrecht wrote:
tell application "Terminal"
do script with command "sudo /usr/local/bin/router restart"
end tell
Result in shell: Password:
look at the man page for sudo and you'll see this switch:
-S The -S (stdin) option causes sudo to read the password
from standard input instead of the terminal device.
so you could pass a file with the password as stdin.
note that any script with your password in clear text is a
security risk. there's probably another way to do what you
want with "setuid root", but i'm not well versed in that.
steve harley email@hidden