How to add authentication to ssh dynamic port forwarding?
- by Aalex Gabi
I am using ssh as a SOCKS server by running this command on the server:
ssh -f2qTnND *:1080 root@localhost
There is one problem: anybody can connect to the server and use it's internet connection.
Options:
To use iptables to filter access to the server, but I connect to the server from various non-statically allocated IP addresses so I would have to edit very frequently those filters which can be annoying.
To install a SOCKS server on the remote. Ultimately this is the last option if there is no other simpler way to do it. (I am very lazy)
Launching the same command on clients machines. The problem here is that some clients don't run on Linux and it is awkward to set up the tunnel (Windows + Putty).
Is there a way to add authentication to a SOCKS server made using ssh?
Bonus question: How to add encryption between the client and the server (made using ssh)?