脚本自动登录ssh

先emerge expect
脚本内容如下
#!/usr/bin/expect --
set timeout 30
spawn ssh username@host
expect "Password:"
send "mypass\r"
interact

参考
http://618119.com/archives/2008/05/10/87.html
posted @ 2009-09-15 18:03  明月我心  阅读(247)  评论(0编辑  收藏  举报