linux自动登录脚本

#!/usr/bin/expect -f
set host 10.1.2.3
set user root
set password 123456
#set timeout -1

spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof


$ ssh [email protected]
[email protected]'s password:


$ whereis expect
/usr/bin/expect


猜你喜欢

转载自blog.csdn.net/pansanday/article/details/80693012