省去每次都要输入地址密码的麻烦
198login.sh
#!/usr/bin/expect -f
set user "name"
set host "xxx.xxx.xxx.xxx"
set password "123456"
set timeout -1
spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof
执行
chmod +x 198login.sh
./198login.sh
网友评论