Once the tunnel is set up (with
-L) you need to change the URL you use, e.g.
http://127.0.0.1/ or if the site name must match due to the virtual-hosting set up then you'll need to add that to your desktop hosts file:
You could define an alias on the server vhost so that you can use one name for 127.0.0.1 like "test.domain.com", and the real name to go directly, if that's ever going to be useful -- forgetting to remove entries from the hosts file is a good way to cause confusion. Depends on how the site works.
To forward port 80 you only need to be root on the desktop, ''not'' the webserver. I'd strongly suggest not allowing ssh login for root.
Using a non-privileged port may work, again depending on your site:
ssh user@webserver -L 1080:127.0.0.1:80
and use the URL
Using a SOCKS proxy (
-D) as suggested may cause some surprises, depending on SOCKS/DNS/firewall/NAT configuration.
(On linux as an alternative to being root for reserved ports you can use POSIX capabilities, see https://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-1024-on-l , however this will not work on standard versions of OpenSSH as it has an extra hard-coded check on port numbers, unless compiled with
NO_IPPORT_RESERVED_CONCEPT defined. The answers to the linked question have various other solutions to that.)