On Thu, 20 Apr 2006 10:02 am, Simon Wong wrote: > I am wanting to do a command with sudo via ssh that requires a password > but the problem is that when I enter the password it is echoed to the > screen. > > ie > > ssh [EMAIL PROTECTED] "sudo apt-get dist-upgrade" > password: PASSWORD-HERE > > Is there a way to stop this being echoed or a better way to do this?
Add "user" to the "sudo" group on "host" and you wont be prompted for the
user's password anymore (at least that's how it works on Ubuntu and RHEL).
Alternatively, login and run the commands interactively (but given you're
running commands directly from ssh, I'm assuming this is actually a script?).
If you go with the sudo group idea, you may want to setup a special user
("updater" or something) that can only run specific commands like "apt-get"
with sudo and even then, restrict the options that can be passed as well.
HTH,
James
--
A fool and his money are soon popular.
pgplLkJWMxnWt.pgp
Description: PGP signature
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
