ssh export 无交互登录 mac iterm2 配置主机自动登录
作者:互联网
rui.qin.o@MBC02XT0K4JGH7 bin % cat login.exp
#!/usr/bin/expect
set timeout 30
spawn ssh -p [lindex $argv 2] [lindex $argv 0]@[lindex $argv 1]
expect {
"(yes/no)?"
{send "yes\n";exp_continue}
"password:"
{send "[lindex $argv 3]\n"}
}
interact
rui.qin.o@MBC02XT0K4JGH7 bin % ./login.exp jenkins 10.110.93.11 22 12345
标签:bin,rui,exp,登录,iterm2,argv,mac,expect,lindex 来源: https://www.cnblogs.com/ruiy/p/15951993.html