Launching firefox on remote server causes local firefox to open the page instead

9

2

Right, this is strange. I am connecting from my laptop (LMDE) to a remote host (SUSE Linux enterprise) using ssh -X. I want to launch a Firefox instance running on the remote server so I can have access to webpages on a private network.

User@RemoteMachine $ which -a firefox
/usr/bin/firefox
User@RemoteMachine $ /usr/bin/firefox --version
Mozilla Firefox 2.0.0.2, Copyright (c) 1998 - 2007 mozilla.org


User@LocalMachine $ which -a firefox
/usr/bin/firefox
User@LocalMachine $ /usr/bin/firefox --version
Mozilla Firefox 14.0.1

Now, if Firefox is not running on the local machine, everything goes as expected and executing firefox on the remote machine causes a Firefox (v 2. 0) window running on the remote machine to show up. However, if Firefox is running on the local machine a second window of Firefox 14. 0. 1 running on the local machine appears.

I have checked top in both machines. In the 2nd case, a Firefox process briefely appears on the remote machine and then disappears when the local version of Firefox is launched.

My questions are the following:

  1. What gives? How/why can Firefox connect to its existing instance on the local machine? The remote machine appears to have access to the local machine. It, in fact, appears to have the right to execute programs on my local machine. Am I missing something or is this just weird?

  2. Is this not a security risk?

terdon

Posted 2012-08-15T17:05:59.150

Reputation: 45 216

Answers

7

By default, Firefox will talk to the existing Firefox process and reuse it.

If you wish to override this behavior and start a new process, add the -no-remote command line option when starting the second Firefox process:

firefox -no-remote

Michael Hampton

Posted 2012-08-15T17:05:59.150

Reputation: 11 744

1Thanks, that's a good tip. The question, however, still stands on whether it is a security risk and how the remote user gains the priviledge to execute a local command. – terdon – 2012-08-15T21:26:58.027

2

The -X switch forwards remote X clients to your local X server. Firefox must use some internal X Window system communication mechanism to detect that it's already running on your display and tell the already-running instance to open a new window.

Fran

Posted 2012-08-15T17:05:59.150

Reputation: 4 774

If I read ssh's man page right, setting -X just enables X forwarding via ssh on a system that doesn't have X forwarding enabled in the configuration files, i.e. ForwardX11 yes and ForwardX11Trusted yes in /etc/ssh/ssh_config If anyone knows details about the internal X Window system communication you mention, I would be very interested in knowing them, because it may have to do with a problem I'm trying to find out about: http://unix.stackexchange.com/questions/64335/newer-versions-of-mozilla-iceweasel-icedove-not-working-when-x-forwarding-is

– zebonaut – 2013-02-24T09:41:25.803