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.

This site uses Akismet to reduce spam. Learn how your comment data is processed.