-2
shell代码:期望自动登录sucess,但不能Exec的任何命令
〜猫test_longin.sh
#!/usr/bin/expect
set timeout 120
spawn /usr/bin/ssh [email protected]
expect "*assword*"
send "fuyou\n"
interact
当我键入./test_login.sh
,它可以成功登录目标服务器,但当我执行ls
命令时,控制台不输出任何文本。所以我不能在目标服务器上执行任何操作。交互是否有问题?