Running a remote instance of Firefox over an SSH tunnel



Published: 2019-06-05 09:52:49 +0000
Categories: BASH,

Language

BASH

Description

Just occasionally I need to briefly run Firefox over an SSH connection, normally because I need something that's stored in Firefox on another machine (like a password that went into FF's manager by accident, or a bookmark - though those are easier dealt with another way)

This isn't something you want to do routinely, unless the remote end has very good upload speeds (even then, the repaints will be painful) and is only really viable as a means of last resort.

Simply creating a tunnel and running firefox won't work though, as by default Firefox will check for and connect to any existing instances, so you'll effectively just get a new firefox window on your local machine with no access to the data you're trying to access.

To avoid this, you need to use Firefox's no-remote argument.

Snippet

# Create the SSH tunnel
ssh -X [remote host]

# Run Firefox from within the SSH session
firefox -no-remote

Keywords

firefox, ssh, tunnel, remote,

Latest Posts


Copyright © 2019 Ben Tasker | Sitemap | Privacy Policy
Available at snippets.bentasker.co.uk and snippets.6zdgh5a5e6zpchdz.onion