Yhzhtk / note

知识代码笔记
https://github.com/Yhzhtk/note/issues
MIT License
108 stars 11 forks source link

SSH 自动登录脚本(自动输入密码) #17

Open Yhzhtk opened 9 years ago

Yhzhtk commented 9 years ago
#!/usr/bin/expect

set server [lindex $argv 0];
set timeout 3

spawn ssh daihui.gu@$server
expect "passphrase"
send "mypassword\r"
interact