8
1
I recently set up a remote server, which I have running the bare minimums currently. I set up OpenSSH and can access the machine through one of my domain names (using an A-type DNS record). I also have a web server running on the machine, but all ports except SSH are blocked at the gateway.
While in the future I plan to open port 80, for now as I'm in "development" mode, and I would like to disallow any outside access or traffic to the web server through port 80 (or over the HTTP protocol for that matter). Right now, the only way to access the machine externally is through an SSH connection.
Now, I was wondering: how can I redirect the local HTTP server traffic through SSH so I can access my web server locally? Can this be done even if I have port 80 firewalled at the router/gateway?
Awesome, thank you! I had heard of SSH tunneling before, but hadn't used it since now. Note that I did have to use
sudo
to run this command. – Breakthrough – 2013-07-19T14:22:47.5372Actually, as a small follow-up to my previous comment; running the command without
sudo
will cause the errorPrivelaged ports can only be forwarded by root.
to appear. However, once I prependedsudo
to the SSH command, I noticed my RSA-key credentials were being rejected. Note that unless yoursudo
user shares the same SSH keys, you will need to specify the path to your current keyfile using the-i
argument (e.g. append-i /home/YOUR_USERNAME/.ssh/id_rsa
to the end of the command). – Breakthrough – 2013-08-24T18:22:51.640