Saturday, July 7, 2012

ssh with password

if you want to run the "ls" command on a remote host:

expect -c 'spawn ssh myuser@acmehost ls ; expect assword ; send "mypassword\n" ; interact'


it works like a breeze!

only problem is that you are exposing your password in clear text...

No comments: