脚本"/>
macOS iterm2 ssh自动登录脚本
代码内容
将代码存在任意位置,文件扩展名为 .sh
将此脚本文件的权限提升。(使用 chmod +x xxx.sh 命令)
#!/usr/bin/expect -f
set user root
set host 121.xxx.xxx.xxx
set port 22
set password xxxxxxxxxx
set timeout 30
spawn ssh -p $port $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof
配置iTerm2
打开Profiles => 新建一个Profile => Command处配置为 上面脚本存放的位置
使用
打开你上面配置的Profile,就可以登录了
更多推荐
macOS iterm2 ssh自动登录脚本
发布评论