ssh -D portnumber username@host -N
As I mentioned before , SSH is a better way to fuck the G*W. But how do I use ssh in a linux system?
You can find the answer everywhere , and all of them are the same : ssh -D portnumber username@host
I a dreamhost user, and a newbie to linux world , I cannot success to do that , when I execute the command , i receive the following messages:
Welcome to athens.dreamhost.com Any malicious and/or unauthorized activity is strictly forbidden. All activity may be logged by DreamHost Web Hosting. Last login: Sun Mar 7 03:07:34 2010 from xxx.xxx.xxx.xxx This account allows only ftp connections. Connection to athens.dreamhost.com closed.
and , then nothing happens. I still cannot visit twitter.com.This problem troubles me for days.Today is Sunday , I tried again. I read the message carefully this time , but still did not know how to do.
Then , I execute : man ssh in the shell , and found a parameter : -N. It is decribed : -N Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only).
Oh , it is just what I need!!
Here is the script :
#!/usr/bin/expect set timeout 60 killall -9 ssh spawn /usr/bin/ssh -D 7070 -g username@youserver.com -N -f #这里的 username 为你自己的用户名,yourserver.com 为你自己的服务器域名或ip vexpect { “password:” { send “passwordr” #将第二个 password 改为你自己的密码 } } interact { timeout 60 { send ” “} }