Mac – Putty – equivalent Mac SSH client and commands

macPROXY

I'm trying to find out what the equivalent Mac SSH client is and set of commands are that would achieve the below. In Windows we use the Putty CLI utility 'Plink' to set up a SSH connection to a SSH server for web proxying purposes.

plink -l username -pw password -D 8080 -P 443 -ssh 1.2.3.4

This command establishes a SSH connection to host IP: 1.2.3.4 over port 443 using the username and password specified. It then presents a local port (8080) available for other applications on the local host to connect to, for example a web browser. Within the web browser we configure a SOCKS proxy using our own IP address or 'localhost' as the proxy server, with port 8080.

I don't know enough about Mac to replicate this putty tool's function and it's not a standard ssh client and I haven't seen plink documented to map things to a unix situation.

Best Answer

This is standard ssh and covered in the man page for TCP forwarding.

ssh -f -L 8080:localhost:443 1.2.3.4 sleep 10

I changed as little from the manual page (8080, 443, 1.2.3.4) so you can find it and the explanation there on OS X. You will want to increase the sleep time if you browser isn't going to connect in the next 10 seconds.