autossh
autossh copied to clipboard
Password-free automatic login SSH(免密登陆SSH)
应为`登录`,而不是`登陆`
compatible first login

在使用过程中遇到有时候服务器要求输入的password:提示是大写,即"Password:",此时程序会卡住。在`expect password:`中加入`-nocase`,即`expect -nocase "password:"`,则可以正常登陆
密码中包含`-`符号会报错。 ``` Server Number:2 spawn ssh -p22 -l root testsite ": must be -i, -h, -s, -null, -0, -raw, -break, or -- while executing "send -testpassword\r" (file "/tmp/.login.sh" line 5)...
检查是否配置了~/.ssh/config储存密码选项 Host * ControlMaster auto ControlPath ~/.ssh/%h-%p-%r ControlPersist yes 如果有配置,请删掉即可。