使用expect自动自动登陆ssh和telnet[@more@]
cat de03
#!/usr/users/nmds/bin/expect -f
set timeout 30
spawn telnet dw03
expect "login:"
send "nmdsr"
expect "Password:"
send "12345r"
interact
=============
cat dw01
#!/usr/users/nmds/bin/expect -f
set timeout 30
spawn ssh -lelink dw01
expect "password:"
send "12345r"
interact
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/640706/viewspace-1048336/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/640706/viewspace-1048336/