1賬號密碼方式: 保存登錄命令文件 /var/www/ssh/xxx.txt spawn ssh -p 22 root@192.168.0.2 expect { "yes/no" {send "yes\r";exp_continue;} "*password:*" { send "$PASSWORD\r" } } interact 2 跳板機 sp