shell
#!/usr/bin/expect spawn ssh root@192.168.137.141 expect "*password:" send "lizhenghua\r" expect "*#" interact
需要安装expect, 如果执行失败
yum install expect -y
shell
#!/usr/bin/expect spawn ssh root@192.168.137.141 expect "*password:" send "lizhenghua\r" expect "*#" interact
需要安装expect, 如果执行失败
yum install expect -y
转载于:https://www.cnblogs.com/chenglee/p/9024977.html