login ssh automatically

expect scripts for automated login with ssh connection.

#!/usr/bin/expect
set timeout 60
set PASS xxxxx
spawn /usr/bin/ssh root@ns2
expect “Password: “; send “$PASS\r”
interact

Leave a Reply

Your email address will not be published. Required fields are marked *