We help IT Professionals succeed at work.

What is SOCKS and can we use SSH port forwarding to achieve it?

Balbir Singh
Balbir Singh used Ask the Experts™
on
I have been playing with SSH local and remote port forwarding and have a little understanding of it. I am wondering if it is same as SOCKS protocol and how using SSH dynamic port we can achieve it.

Also, I am wondering what is the use case of SOCKS when we have VPN and port forwarding.

Thanks in Advance
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Describe exactly what you're trying to accomplish.

This context will help shape answers.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
ssh port forwarding is protocol agnostic.  When ssh receives a connection request, it will pass this on to the system mentioned the linked settings.
And it will forward all data...  There is no communication about the connection between program & SSH.

Socks is a protocol where your program talks to the proxy to request several things on it's behalf.  So there is active communication between the proxy & the program about the connections.

This better explains Socks proxies and where they belong.
https://surfshark.com/learn/socks-proxy

Socks does NOT encrypt, it can authenticate.
Software Engineer
Distinguished Expert 2018
Commented:
After thought there is an option -D on the ssh command line that will allow ssh to act as a SOCKS 4 or 5 forwarder. (not that often used)

Check man ssh  for more info.