SUSE Support

Here When You Need Us

Run X application through ssh with no password required.

This document (7000906) is provided subject to the disclaimer at the end of this document.

Environment

Linux system running a shared application (server) that allows ssh connections.

Linux system (client) that will access the server application.

The instructions assume that both systems are one of the following:
SUSE Linux Enterprise Desktop 10 (SLED)
SUSE Linux Enterprise Server 10 (SLES)
openSUSE 10.x or 11


Situation

Need to run a graphic application on a specific Linux system (server) but would like to view and have control of the application on a different Linux system (client).

Many situations call for the ability to have a powerful central server running a needed application but allowing other client systems to access the server to run the application.  One way to do this is through ssh.  The following instructions will explain how to setup ssh so it will not require a password from the user and also the command that can be used launch the graphic application and have it displayed on the client system.

Resolution

First Step

Setup ssh to allow a connection from the client to the server (where the application resides) with no password required.

1.  The same user ID must be setup on both the client and server systems.  For this example let's use jdoe.

2.  On the client system while logged in as the user (jdoe) open a terminal window and enter the command:

ssh-keygen -t rsa

The following will be displayed (with your user ID rather than 'jdoe'):

Enter file in which to save the key (/home/jdoe/.ssh/id_rsa):

Press <Enter> to accept this default file.
You will then be asked for a pass phrase:

Enter passphrase (empty for no passphrase):


Just press <Enter> for no passphrase.
You will now have the public and private keys created in the users .ssh directory.

3.  Now switch to the server system and login as the same user (jdoe in this example).  For this example let's assume the client system's IP address is '10.1.1.2'.  Open a terminal window and enter the following commands:

mkdir ~/.ssh
scp jdoe@10.1.1.2:~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

There is the possibility that the ~/.ssh directory already exists and if keys have been added previously to this server system for this specific user there may also be a ~/.ssh/authroized_keys file.  If this is the case and this user will need access from multiple systems then you can add this new key to the already existing authorized_keys file.  Just use the 'scp' command to copy the file from the client to a different location on the server.  The use the command:

cat id_rsa.pub >> ~/.ssh/authorized_keys

This will append the information in the id_rsa.pub file to the already existing authorized_keys file.

You should now be able to ssh from the client system to the server system with no password requested.

Second Step

Use a command line to launch the application or create a launcher icon on the desktop.

1.  Use the following command to launch the application from the client system.  Let's assume the IP address of the server is '10.1.1.1' and the application is '/opt/gnome/bin/gcalctool':

ssh jdoe@10.1.1.1 -X /opt/gnome/bin/gcalctool

Just replace the command with your user ID, server IP address, and binary executable file.

2.  Create a launcher by right clicking on your desktop and in GNOME select "Create Launcher".  In KDE select "Create New --> Link to Application".  In either case you will enter the command used above to successfully run the application for the"Command" line in the new launcher.  Enter the other information as appropriate for your setup and select a suitable icon.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7000906
  • Creation Date: 10-Jul-2008
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Desktop
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.