mac免密登陆iTerm2

mac下使用iTerm2,通过命令ssh需输入密码访问liunx,现在跟大家分享一个无密的方法。

1.准备脚本, cd ~/.ssh touch 238 vi 238 然后

 #!/usr/bin/expect -f
set user <用户名>
set host <ip地址>
set password <密码>
set timeout -1

spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof

2. 53490262.png 转载自 http://orchome.com/99

标签: none