使用iTerm2快捷连接SSH

在~/.ssh编写好blj.sh文件



#!/usr/bin/expect set timeout 30 spawn ssh -p 端口 用户名@服务器IP expect { "(yes/no)?" {send "yes\n";exp_continue} "password:" {send "密码\n"} } interact

  这里[lindex $argv 0], [lindex $argv 1], [lindex $argv 2], [lindex $argv 3]分别代表着4个参数,然后回来终端添加sh路径

 

posted @ 2016-12-31 10:13  sky10001  阅读(328)  评论(0编辑  收藏  举报