mac的iterm2用ssh连接服务器很方便,就是每次要输入密码,很是烦人。这个在网上找到一个方法做一个记录。
在/Users/steven/.ssh/下新建一个文件。文件名可以是你服务器最后的三个数字,反正你自己知道就行。文件内容如下:
#!/usr/bin/expect -f set user 用户名 set host 服务器ip set password 密码 set timeout -1 spawn ssh $user@$host expect "password:*" send "$password\r" interact expect eof
然后在iterm2的profiles里新建一个
147是我新建的文件的名字
转载于:https://blog.51cto.com/xtceetg/1913693