3 ms·
I think you want something like the -R switch for the standard openssh client (that is, the ssh command in most Linux distributions -- read man ssh) for this; i
by gunapologist99 5y ago
I think you want something like the -R switch for the standard openssh client (that is, the ssh command in most Linux distributions -- read man ssh) for this; it allows you to have the remote client connect to your server running on your localhost.
While you're reading the man page, also check out -L, which allows you to connect to a remote server through the encrypted tunnel. This is the most common usage.
For example, let's say that you have a webserver running remotely that is only listening on localhost. Why would you do this? Let's say that you are running some sort of server management dashboard, but you're not sure how secure it is and you want to only connect to it yourself. Even though it is only listening on localhost, you can still connect to it remotely.
From your workstation,
ssh -L 9000:localhost:8000 remoteserver
This will allow you to open up http://localhost:9000 http://localhost:9000 in your browser and access the remote web server that's listening only on its localhost on port 8000.