Securely run programs on a remote host in Unix

These instructions assume you are using OpenSSH and are trying to run an X11 program remotely. If you receive an error about -X not being an option, try leaving it out or replacing it with +x (i.e., ssh +x -f host command).

If you want to run programs securely on a remote host you can use SSH or SSH2 to run X Window (X) applications and many command-line applications that reside on a remote Unix host. To do this, at the shell prompt, enter:

  ssh -X -f hostname command

Replace hostname with the name of the remote host, and command with the name of the application. If you have not set up public key authentication, you will be asked for your password on the remote host. If you have set up public key authentication, you will be asked for your private key password.

For example, assuming you are running X, you could start xemacs from the computer by entering the following:

  ssh -X -f xemacs

If your username on the remote host is different from your local username, the following command will work:

  ssh -X -f username@host command

So, again assuming you are using X, to run xemacs on under the username dvader, you would enter:

  ssh -X -f xemacs

At Indiana University, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.

This is document aidu in the Knowledge Base.
Last modified on 2019-01-09 10:18:16.

Contact us

For help or to comment, email the UITS Support Center.