Wednesday, July 29, 2015

SSH Connect Script without prompting for password and automatically sudo su

#!/usr/bin/expect -f
spawn ssh user@hostname
expect "assword:"
send "mypassword"
send "sudo su -\r"
interact

No comments:

Post a Comment