How to start a GUI software on a remote Linux PC via SSH


What Is SSH?

One essential tool to master as a system administrator is SSH.

SSH, or Secure Shell, is a protocol used to securely log onto remote systems. It is the most common way to access remote Linux and Unix-like servers.

In this guide, we will discuss how to use SSH to connect to a remote system.

Basic Syntax

The tool on Linux for connecting to a remote system using SSH is called, unsurprisingly, ssh.

The most basic form of the command is:

The remote_host in this example is the IP address or domain name that you are trying to connect to.

This command assumes that your username on the remote system is the same as your username on your local system.

If your username is different on the remote system, you can specify it by using this syntax:

ssh remote_username@remote_host

Once you have connected to the server, you will probably be asked to verify your identity by providing a password.

Later, we will...

0 0

I can log into the remote Ubuntu (Kubuntu 12.04) machine. Using the info from (How to start a GUI software on a remote Linux PC via SSH) I tried the following after logging in:

[email protected]:~$ export DISPLAY=:0 [email protected]:~$ firefox No protocol specified No protocol specified No protocol specified No protocol specified Error: cannot open display: :0

I expected the same success as stated at the question referenced. Unfortunately, as you see it didn't work for me. The machine has 3 displays. Could that be the issue?

Is there a simple solution? I also read ( but I didn't understand how to use or apply that advice. It was too complicated. I appreciate any relatively simple solutions.

I looked at a running GUI process (Kate) with this:

# cat /proc/2857/environ | tr \\0 \\n | grep -E '^(DISPLAY|AUTHORITY)=' DISPLAY=:0

That further confuses me...

0 0

So what you're saying is that it worked fine with two computers, but a different one wouldn't start whatever you asked it to start?

And just to clarify: What you are doing is that from Computer A you log in to Computer B and start a program that will run on a GUI (or more accurately: on an X-Server) in Computer B, right?

If I am right, are there any differences between the computers it works with and that one that it doesn't work on that you could tell us about? Anything, that might stop you from doing what you are trying to do?


Note to others who don't know: As ssh requires a user account on any PC you do this to, so it is not considered illegal and may therefore be discussed...

0 0

This article was written in the 2014, there may have been some developments in the subject matter.
If in doubt please leave a comment in the bottom of the article.

I do not often have to start an application on a remote machine that requires the use of the GUI, more widely in applications to launch and "turn" in background, but it can always happen. I'm thinking for example to those who use a computer as a multimedia station (with XBMC setup is very simple) or even just to experience.

Suffice it to say that you can do, but it is necessary to direct the GUI application to a screen in particular.

First we will login tramite SSH:

~$ ssh user@

Obviously replace "user" and "" with the IP address of the PC to which we want to connect and the user configured in the PC.

Then we will make sure that requests are diverted to a session-specific graphics:

~$ export DISPLAY=:0

In this case (except for different operations) the first...

0 0
0 0


Secure Shell (SSH) is a UNIX-based command interface and protocol for securely getting access to a remote computer. SSH is actually a suite of three utilities - slogin, ssh, and scp - that are secure versions of the earlier UNIX utilities, rlogin, rsh, and rcp. SSH commands are encrypted and secure in several ways. Both ends of the client/server connection are authenticated using a digital certificate, and passwords are protected by being encrypted.

SSH allows you to connect to your server securely and perform Linux command-line operations.

SSH using sudo

For high-level tasks coupled with increased security, you can set up a sudo user instead. This user normally functions as a lower-level user, but can perform the same tasks as root when necessary.

For all examples that pertain to the root user, a sudo user can do the exact same thing by adding sudo in front of the rest of the command. You will be prompted for the root password,...

0 0