Quick Tip: Use remote Linux GUI system, admin tools locally

This is a reader-contributed article.

Technology has changed dramatically in the last decade. OpenSSH is one the best project. It allows you to control remote Linux / UNIX server using command line or GUI tools.

Do you miss GUI configuration server management tools such as Debian network-admin or Redhat/Cent os system-config-* tools/utilities while administrating a Linux server? Do you want to run GUI admin tools on a remote Linux server and get display on local desktop or laptop X server system?

I have been using OpenSSH X11 forwarding and it works very well with DSL / ADSL/ cable connections.

Sample setup

Our setup is as follows:
#1: Remote Redhat Enterprise / Debian Linux Server
IP address:

#2: My IBM laptop running Ubuntu Linux connected via hi speed ADSL connection.
IP address: Dynamic

Step #1: Server Setup

You must have OpenSSH server installed. Open SSHD configuration file /etc/ssh/sshd_config
$ sudo vi /etc/ssh/sshd_config
Turn on X11Forwarding by setting X11Forwarding parameter to yes:
X11Forwarding yes

Save and close the file. Restart OpenSSH server you so the changes will take place:
$ sudo /etc/init.d/ssh restart
If you are using RedHat server, use:
# /etc/init.d/sshd restart

Logout and close ssh connection.

Step # 2: Running a command remotely

Debian Linux has the Network Administration Tool. It allows you to specify the way your system connects to other computers and to internet. Let us run this tool from laptop and make some changes to remote server networking. Open X terminal and type the command:
$ ssh -X /usr/bin/network-admin
Run RedHat Linux system-config-httpd tool (Apache sever configuration tool):
$ ssh -X /usr/bin/system-config-httpd

Basic X11 Forwarding Over SSH - Open HTTPD Config tool
[X11 Forwarding in action]

Within few seconds (depends upon your network speed) you should see a network-admin or system-config-httpd GUI locally. The client desktop/laptop does not need any extra configuration ๐Ÿ™‚

Another option is to connect to the remote server and use X port forwarding:
$ ssh -X

Make sure you replace IP address with actual hostname or IP address.

A note for apple OS X tiger users

Instead of รขโ‚ฌโ€œX option use รขโ‚ฌโ€œY option:
$ ssh -Y
$ ssh -Y system-config-network

Optional : Turn on Automatic X11 Forwarding

You can turn on automatic forwarding by adding following two lines to local OpenSSH client configuration file /etc/ssh/ssh_config or ~/.ssh/config:
$ sudo vi /etc/ssh/ssh_config
Set configuration parameter:
Host *
ForwardX11 yes

Save the changes. You can run almost any GUI program locally ๐Ÿ™‚

Reference Links:

About the author: Rocky Jr., is an engineer with VSNL – a leading ISP / global telecom company in India and a good friend of nixCraft.

๐Ÿง Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

๐Ÿง 14 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
14 comments… add one
  • disgrntld_emu Apr 10, 2007 @ 17:41

    Forget plain old X11 forwarding. Check out NoMachine’s(http://www.nomachine.com/download.php) NX software. It runs over SSH as well but the responsiveness of the NX protocol is unlike any other remote GUI. Don’t be mislead, you can get it all for free if you click the right links on their page =)

  • Nevyn Apr 11, 2007 @ 22:55

    This technique can also be used to serve up Linux applications on a Windows desktop. Brilliant for me – I have the best (and worst) of both worlds.
    You need to install an X-server on the windows machine – read: cygwin.
    And use something like putty to connect up to the server and run your commands from there.
    I’m still having a problem though – I’m still having to run xhost +[Server Address] on my desktop for some strange reason despite all the instructions being followed.

  • Vivek Kapoor Apr 12, 2007 @ 7:37

    If you use -XC intead of just -X then the performance would be far better. C is for Compression.

  • Hans-Werner Apr 12, 2007 @ 10:14

    @Nevyn: “xhost +ServerIP” is dangerous on potentially hostile networks since an IP can be forged. You’re probably having an authentication problem. Check the man page of “xauth”, basically you need to extract the authentication token on the X server (i.e. SSH client) and merge it into the XAuth database on the X client side (i.e. SSH server side).

  • arbuzz Apr 12, 2007 @ 18:48

    “A note for apple OS X tiger users”

    Say what I need to be able to make this work on iBook?

    I got this error: /usr/share/system-config-network/netconfpkg/NC_functions.py:30: DeprecationWarning: rhpl.log is deprecated and will be removed; use python’s logging instead
    import rhpl.log
    TERM environment variable needs set.

  • Danny Williams Apr 12, 2007 @ 19:27

    But why not just use TightVNC?

  • Terrell Prude' Jr. Apr 12, 2007 @ 23:23

    You might also have to throw the “ForwardAgent yes” setting in /etc/ssh/ssh_config in order for this to work. I’ve run into that.

    Good tip, though. I use X11 forwarding at work all the time, and it’s very handy. Way better than the old telnet/xhost way.

  • What is Software? Apr 14, 2007 @ 8:00

    Could you do an article on installing X on a windows machine. That’s all my university has. Better yet, X on a disk-on-key, like Portable Apps, would be great.


  • Stuart Apr 17, 2007 @ 15:33

    It’s best not to enable X11Forwarding for all connections (i.e. don’t enable it in /etc/ssh/ssh_config)… it used to be the default and there’s a very good reason why it is no longer. It’s dangerous.

    It turned out that a remote attacker could sniff your keyboard and mouse movements (or possibly even more horrible things) just because you ssh’d onto a box that they had cracked. In short, it turned into a great way of cracking the next host up the chain.

    I generally define two connections in .ssh/config for any machine, say foo.example.com — one connection I call “foo” and the other “xfoo”. I then have X11Forwarding turned on for only one of them. And of course, by using the config file, I can automatically get all the other benefits it brings — I turn on compression and can specify an identity file for pubkey login too.

  • Scott Bohler Jun 17, 2007 @ 3:35

    Very useful. Thank you!

  • p3ace Jan 8, 2009 @ 13:00

    Nice ! This is very usefull and simple !

  • vinay Apr 16, 2009 @ 7:20

    I tried this method but was unsuccessfull in launching GUI applications on the local system. I checked and made sure that X11Forwarding is set as YES on the remote system. I connect to the remote system using ssh -X .
    Now, when i type gedit on the terminal window, the gedit editor open in the remote terminal. Please advice as to what settings i am missing which will enable me to open the GUI on the local system.


  • Abdulrahim Jan 14, 2012 @ 15:33

    hi friend
    if i wrote this as bellow
    [abdulrahim@redhat ~]$ ssh -X ali@redhat.com /usr/bin/network-admin
    bash: /usr/bin/network-admin: No such file or director

    this is result. what’s the problem? i don’t understand

  • Abdulrahim Jan 14, 2012 @ 16:02

    hi friend
    scenario is: I pc but no any network just local. so can i use (ssh) between users in same pc as bellow is right no any problem

    [abdulrahim@redhat ~]$ ssh -X ali@redhat.com
    Last login: Sat Jan 14 18:29:45 2012 from redhat.com
    [ali@redhat ~]$

    but if i use this command as bellow is
    [abdulrahim@redhat ~]$ ssh -X ali@redhat.com /usr/bin
    bash: /usr/bin: is a directory

    this problem the same before this comment
    so what’s problem for that? it must go in this folder right or not????!!!!!!!

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum