X11 Forwarding

Article ID: 256
Last updated: 25 Mar, 2026

To run X applications (such as xclock, emacs, totalview, etc) on the X client host (for example, a NAS system such as pfe25, etc.) and display them back to an X server (such as your local system), the simplest way is to use SSH X11 Forwarding.

If you are using a NAS-supported workstation or compute server, X11 Forwarding is already set up for you. The following command activates SSH X11 Forwarding automatically:

your_local_system% ssh hostname.nas.nasa.gov 

Most modern SSH client software support this option (for example, Cygwin, TeraTerm, PuTTY, Unix, and Linux). To use SSH X11 Forwarding, the SSH server-side daemon (sshd) configuration file must contain the entry:

X11Forwarding yes 

to support the forwarding capability. All NAS-supported hosts (including all workstations and compute servers) honor this setting in the default sshd_config file (for High End Computing systems and Linux systems, it is /etc/ssh/sshd_config; for Mac systems, it is /etc/sshd_config) For other non-NAS machines, ask your system administration to set this in the sshd_config file.

In addition to setting X11Forwarding yes on the SSH server side (for example, a NAS machine), it is recommended that ForwardX11 yes is also set in the ssh_config file on the SSH client host (for example, your local system). By default, NAS and HEC system configurations will enable these settings for both client and server. If ForwardX11 yes is not set in the ssh_config file by the system administrator of your local system, you can set it in your ~/.ssh/config file or use the -X option of SSH.

Other parameters related to the performance of X11 Forwarding are handled by the NAS-recommended ssh_config file. If you are on a NAS-supported system, no action is needed in setting these parameters yourself. If your local system is not supported by NAS and you would like to get configuration ideas, you can look at /etc/ssh/ssh_config on any NAS high-end computing system, such as pfe[20-22,25,26].

Example

To run an X11-based application, for example, xclock, on pfe25.nas.nasa.gov and have it displayed on your local system, do the following:

your_local_system% ssh pfe25.nas.nasa.gov
------------------------------------------------------

      * * *  W A R N I N G     W A R N I N G * * *
 
                U.S. GOVERNMENT COMPUTER
 If not authorized to access this system, disconnect NOW.
....
------------------------------------------------------
                    ** PFE25 **                                     
....

pfe25% xclock

To run an X11-based application on a NAS-supported desktop, follow the example below:

your_local_system% ssh sfe1.nas.nasa.gov
sfe1% ssh a_nas_desktop
a_nas_desktop% xclock

If ForwardX11 yes is not set in either the ssh_config file or the ~/.ssh/config file of your local system, use:

your_local_system% ssh -X hostname.nas.nasa.gov 
WARNING: The SSH daemon sets the DISPLAY environment variable by itself. DO NOT RESET it to point to display zero (for example, setenv DISPLAY your_local_system:0), otherwise SSH X11 Forwarding will not work.
WARNING: For each new login, the .Xauthority file gets updated. If you are over your quota, this file cannot be updated and you get the error:
/usr/X11R6/bin/xauth:  error in locking authority file 
/u/username/.Xauthority 
X11 Forwarding will not work if you receive this error.

Contact Us

General User Assistance

Security

  • Report security issues 24x7x365
  • Toll-free: 1-877-NASA-SEC (1-877-627-2732)
  • E-mail: soc@nasa.gov

User Documentation

High-End Computing Capability (HECC) Portfolio Office

NASA High-End Computing Program

Tell Us About It

Our goal is furnish all the information you need to efficiently and effectively use the HECC resources needed for your NASA computational projects.

We welcome your input on features and topics that you would like to see included on this website.

Please send us email with your wish list and other feedback.