Skip to content

Instantly share code, notes, and snippets.

@ninehills
Forked from fuckgfw/sshgfw
Created July 30, 2010 05:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ninehills/499932 to your computer and use it in GitHub Desktop.
Save ninehills/499932 to your computer and use it in GitHub Desktop.
linux下ssh翻墙断线重连
#!/usr/bin/expect
set timeout 60
spawn /usr/bin/ssh -D 7070 -g username@yourserver.com
#这里的 username 为你自己的用户名,yourserver.com 为你自己的服务器域名或ip
expect {
"password:" {
send "password\r"
#将第二个 password 改为你自己的密码
}
}
interact {
timeout 60 { send " "}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment