Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created March 9, 2010 07:33
Show Gist options
  • Save lxneng/326350 to your computer and use it in GitHub Desktop.
Save lxneng/326350 to your computer and use it in GitHub Desktop.
#使用expect
#!/usr/bin/expect -f
#auto ssh login
set timeout 30
#set sshhost [lindex $argv 0]
spawn ssh -D 9527 [email protected]
expect "password:"
send "password\r"
interact
#使用公钥/密钥
ssh-keygen -t dsa
ssh-copy-id -i .ssh/id_dsa.pub [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment