For viewing plain HTML files on the local browser, you can use SFTP. Open the file browser (Nautilus) and go to File -> Connect to a server. The address will look like: sftp://user@hostname.com
. You'll have to add your identity to the SSH agent (ssh-add user.pem
) for key-based login to work correctly. Once connected, navigate to your HTML file and open them.
With X11 Forwarding, you can do this:
ssh -C -c blowfish -X -i user.pem user@hostname.com
# On the remote shell
firefox /path/to/index.html &
Firefox will open on your local system, but will actually run on the server.
A third option, if you're willing to set up a static web server, is to set up port forwarding and then open it in your local browser:
ssh -C -c blowfish -X -i user.pem -L 9000:localhost:9000 user@hostname.com 'cd /path/to/; python3 -m http.server 9000'
Then, in your local browser, open http://localhost:9000
.