Ssh – Launch firefox on remote server using SSH with a command line parameter

command-line-interfaceremote desktopssh

Is there a way to launch firefox on a remote server using SSH this way ? :

ssh username@ip_address [command line]

When I run: ssh username@ip_address -Y (or -X) firefox (I want to launch firefox on the remote -Ubuntu Desktop- from my local -Ubuntu Server), I get this error: Error: no display specified

Important note: I want to run this command from an Ubuntu Server to an Ubuntu Desktop operating system.

Best Answer

You can use X Forwarding to do that. Make sure that firefox is installed on your server, then from your desktop, run:

ssh username@ip_adress -Y [command line]

if -Y does not work, you can still use -X instead.

If it's not working, be sure that:

  • in /etc/ssh/sshd_config on the server, X11Forwarding is set to yes
  • in /etc/ssh/ssh_config on the client, ForwardX11 is set to yes. Add the line if needed.
  • xauth is installed on the server : sudo apt-get install xauth

Regards,

Thomas.