Facebook Twitter Instagram
    WiredRevolution.com
    • Home
    • About
    • Contact Us
    • Essential Linux Commands
    • Sitemap
    Facebook Twitter Instagram
    WiredRevolution.com
    system administration

    How to X session forwarding over SSH

    RyanBy RyanDecember 4, 20083 Comments2 Mins Read
    Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Email

    SSH allows secure (encrypted and authenticated) connections between two hosts. These connections include terminal sessions, file transfers, TCP port forwarding, as well as X window forwarding which I will be covering here. X forwarding is a form of tunneling that allows you to run a GUI application on a remote machine but let you view and interact with it on your local machine.

    To try this out you will need both X and SSH installed on your local and remote machines. Make sure that you are able to log into the the remote machine over SSH before you continue.

    Simple SSH command, ensure that this works before continuing. You may have to enter a password for the user before it will allow you access.

    $ ssh user@remotehost
    

    The next step is to add the ‘-X‘ option. This will turn on X forwarding and allow you to remotely run X programs. In this case we will run xclock.

    $ ssh -X user@remotehost xclock
    

    You should see the xclock window appear on your screen. You can interact with it like any other local application window. Close it when you are done.

    If you have a slower connection you can turn on compression by adding the ‘-C‘ option to the command above. This will compress all data communications with the gzip algorithm.

    $ ssh -C -X user@remotehost xclock
    

    If you are experiencing any problems turn on verbose output with the ‘-v‘ option. This will give you a lot more output and tell you what is going on underneath.

    $ ssh -v -X user@remotehost xclock
    

    If you are still having issues look in the ssh configuration file here/etc/ssh/ssh_config, and make sure that you don’t have X forwarding settings disabled.

    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Email
    Previous ArticleRemove Windows carriage returns with tr
    Next Article Customize keyboard shortcuts in GNOME

    Related Posts

    Transfer your ssh public key to a remote machine

    Fix git-upload-pack and git-receive-pack errors on shared hosting

    Setup SSH access between VirtualBox Host and Guest VMs

    Most Commented
    March 12, 2009

    Fix blue tinted video in Ubuntu

    September 10, 2010

    Setup SSH access between VirtualBox Host and Guest VMs

    March 8, 2011

    Install GNOME Shell in Ubuntu 10.10 Maverick

    April 4, 2009

    Setup the PS3 Bluetooth Controller on Ubuntu

    October 22, 2008

    How to correctly use LD_LIBRARY_PATH

    Recent Comments
    • Execute command on linux virtual machine (or server) from windows commandline on Setup SSH access between VirtualBox Host and Guest VMs
    • Solved: How to SSH to a VirtualBox guest externally through a host? - Daily Developer Blog on Setup SSH access between VirtualBox Host and Guest VMs
    • How to SSH to a VirtualBox guest externally through a host? [closed] – Code D3 on Setup SSH access between VirtualBox Host and Guest VMs
    • How to copy and paste from VirtualBox? [duplicate] on Setup SSH access between VirtualBox Host and Guest VMs
    • Jackie Laguna on Fix OpenGL: ChoosePixelFormat SketchUp error in WINE
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.