17 10 2013

SSH 自动登陆输入密码脚本

bigCat Posted in Linux - Comment.isBlank
#!/usr/bin/expect -f\n\nset port 22\nset user bigcat\nset host 10.20.30.40\nset password helloworld\nset timeout -1\n\nspawn ssh -p $port $user@$host\nexpect "*assword"\n\nsend "$password\r"\n\ninteract\n

\n

Host: (miao) | Word: Press | Code: HTML5