通过expect免自动输入密码登陆远程服务器
1、前提必须已经安装expect
2、新建login.sh,文件内容如下
#!/usr/bin/expect -f
spawn ssh root@140.10.10.52
expect "password:"
send "passwordR
"
interact
3、执行./login.sh即可登陆远端服务器
通过expect免自动输入密码登陆远程服务器
1、前提必须已经安装expect
2、新建login.sh,文件内容如下
#!/usr/bin/expect -f
spawn ssh root@140.10.10.52
expect "password:"
send "passwordR
"
interact
3、执行./login.sh即可登陆远端服务器