Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ketulshah

macrumors newbie
Original poster
Feb 27, 2012
3
0
Hello guys, I doubt this is classified as a programming discussion or no, but this was the nearest it could get to.

I want to SSH tunnel into a server through the LAN connection provided by my university. I am successfully being able to do it using PuTTY on Windows but I failed to bypass the proxy server out here using terminal. Mainly, I don't understand the codes needed to be written in the Terminal. PuTTY was very simple to handle and had an ice GUI.
I'd really appreciate if someone could tell me the command line to use. I read hundreds of pages and saw many videos couldn't get a word out of it.

PS : The computers connect to the internet here after entering the http and https proxies as 172.30.1.1:8080, and I basically want to bypass these and set up an SSH tunnel so that I could apply a SOCKS 5 proxy.
 
man ssh


you're looking to use the -R option

-R [bind_address:]port:host:hostport
Specifies that the given port on the remote (server) host is to be forwarded
to the given host and port on the local side. This works by allocating a
socket to listen to port on the remote side, and whenever a connection is made
to this port, the connection is forwarded over the secure channel, and a con-
nection is made to host port hostport from the local machine.

etc
 
You're right, this is not a programming question at all. The sub forum you want is Mac Basic Help :

https://forums.macrumors.com/forums/78/

Since you haven't provided any information on how you want to make your SOCKS proxy, just know that the command line options you want are -L, -R or -D depending on the type of tunnel you want to make. These should be exactly like PuTTY's in their syntax.

So let's say under PuTTY you have an entry labeled :

Code:
L3128        localhost:3128

The syntax would be :

Code:
-L 3128:localhost:3128

Alternatively, you could just install PuTTY through Macports :

http://www.dotresults.com/2009/10/28/how-to-install-putty-on-os-x/
 
I really appreciate the support but I'm still not very clear about the command.
See I'll tell you what exactly I entered in the PuTTY for bypassing.

Please tell me what command do I use in the terminal window.

Thanks again.
 

Attachments

  • 1.JPG
    1.JPG
    48.8 KB · Views: 103
  • 2.JPG
    2.JPG
    48.1 KB · Views: 102
  • 3.JPG
    3.JPG
    47.8 KB · Views: 91
  • 4.JPG
    4.JPG
    46.2 KB · Views: 85
So it's like I said :

Code:
-D 5555

It's right there in the man page :

-D [bind_address:]port
Specifies a local ``dynamic'' application-level port forwarding. This works by allocating a socket to listen to port on the local side, option-
ally bound to the specified bind_address. Whenever a connection is made to this port, the connection is forwarded over the secure channel, and
the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are
supported, and ssh will act as a SOCKS server. Only root can forward privileged ports. Dynamic port forwardings can also be specified in the
configuration file.
 
What I understood from your previous two posts is the command below:

ssh -D 5555 -L 5555:172.30.1.1:8080 user@host.com

Does it mean that it will bypass my proxy of 172.30.1.1 at port 8080 to SOCKS 5 at port 5555, because if it does then it doesn't really work. I get an error, operation timed out.
Please correct me.
Thanks a ton for the posts. BOWS.
 
You didn't quite read my posts there. You can't use both -L and -D at the same time on the same local port (5555). And your -L arguments do the opposite of what you want.

Again, read this sentence carefully, it should answer your question :

Since you haven't provided any information on how you want to make your SOCKS proxy, just know that the command line options you want are -L, -R or -D depending on the type of tunnel you want to make. These should be exactly like PuTTY's in their syntax.

So going by your screenshot, you want -D 5555. That's it.

Code:
ssh -D 5555 user@host.com

That will do exactly the same thing as your PuTTY does.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.