MakeTechEasier
  • Home
  •  
  • About
  •  
  • Archives
  •  
  • Jobs
  •  
  • Advertise
  •  
  • Contact Us
  • Windows
  • Linux
  • Mac
  • Internet
  • WordPress
  • iPhone
  • Android
  • All Categories
    • Android RSS
    • Firefox RSS
    • Gaming RSS
    • Google RSS
    • google chrome RSS
    • Internet RSS
    • iPhone/iPod Touch RSS
    • Linux RSS
    • Mac RSS
    • Mobile RSS
    • OpenOffice RSS
    • PC Hardware RSS
    • Review RSS
    • Roundup RSS
    • Windows RSS
    • Windows Mobile RSS
    • WordPress RSS
    • WordPress Plugins RSS
  • rss icon
  • email icon
  • facebook icon
  • twitter icon

How to use SSH X-forwarding to Run Remote Apps

Posted by: Tavis J. Hampton on June 22nd, 2009
  • 6 Comments
  • Share

200x-orgThere are times when it is just quicker, easier or even necessary to use a graphical application, and there are also times when you might be away from the computer that has your crucial applications installed. Whatever the scenario, Linux and other operating systems running an X server have the ability to forward a graphical application through SSH. Following a few simple steps, you can run a remote application in all of its full graphical glory.

Installation and setup

Before you begin you need to make sure that SSH client and server are installed on the correct computers. The host computer that will have the actual running applications needs to have SSH server running. On Ubuntu, it is not installed by default. Look for the packaged called “openssh-server” and install it. On the client computer, you will need “openssh-client“.

The other important preliminary step is to make sure both computers are connected to a network and that you can reach them via SSH. If the computers are in the same building, it will be easy. If not, you might have to configure the host computer to receive SSH connections through the firewall. See your router’s documentation for the correct method of port forwarding.

Connecting

1. Open a terminal emulator: Gnome terminal, Konsole or something similar.

2. Now connect to the host computer. As an example, if the host IP address is 192.168.254.76 and the host username is “bobolina”, you would type the following:

ssh -X -lbobolina 192.168.254.76

This tells SSH to forward the X server calls to the client computer.

3. At the password prompt, enter the password.

4. Run the application. For example, if you want to run Kwrite, just type the command:

dbus-launch kwrite &

(Note: you will need to have “dbus-launch” before KDE 4 applications. Other applications that do not require D-Bus should work without it).

Other Considerations

That is all it takes.  You should now be able to run remote X applications at will. This can be very helpful if, for example, you are running a computer with a very small hard drive, no hard drive at all or even one without a CD-ROM drive, all of which are common with many netbooks and low-cost mini desktops.

To automate this process, you could setup SSH public keys to connect without passwords and write an executable script. Also, if you need a full X session forwarded, you can use NX technology, available with the commercial NoMachine NX or with FreeNX (a free and open source alternative).

As with any network solution, security is always a concern. Using SSH provides a secure connection, but it does little good if your password is easy to guess and your firewall allows anyone to gain access to it. Once you have a secure plan in place, remote X forwarding is an excellent way load remote applications on demand and manage remote machines. The possibilities are only as limited to your imagination and the speed of your network connection. Experiment with different techniques, and let us know what you discover.


Tavis J. Hampton is a librarian and freelance writer from Indianapolis, Indiana. He is an avid user of free and open source software and strongly believes that software and knowledge should be free and accessible to all people. He enjoys reading, writing, teaching, spending time with his family, and playing with gadgets.

Tags: Linux, networking, ssh, xorg
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 1.00 out of 5)
Loading ... Loading ...

Share and Enjoy!

  • Rss feed
  • StumbleUpon It!
  • Del.icio.us
  • reddit

Related Posts

  • How to Use ‘remote:/’ KIO and KNetAttach
  • How to Set Up a VNC Server In Ubuntu Hardy Heron
  • 2 Useful SSH Tricks to Improve Your System Security
  • A Quick and Easy Guide to KDE KIO slaves
  • How to Use Nautilus As a FTP Client

Popular Posts

  • Turn Your Ubuntu Hardy to Mac OSX Leopard 498 comment(s)
  • Turn Your Ubuntu Intrepid Into Mac OSX Leopard 311 comment(s)
  • Download EASEUS Partition Master For Free – 24 Hours Only 174 comment(s)
  • 28 Coolest Firefox About:Config Tricks 122 comment(s)
  • How To Boot And Install Windows 7 From USB Flash Drive 122 comment(s)

Enjoyed the article? Subscribe to Make Tech Easier today to get your daily updates of technology tutorials, tips and tricks.

Enter your email:

2 pingbacks/trackbacks (Click to open)

  • 2 Useful SSH Tricks to Improve Your System Security - Make Tech Easier
  • OmniDownloads | 2 Useful SSH Tricks to Improve Your System Security
[Click to close]

6 Responses

  • Debjit says:
    June 23, 2009 at 1:18 pm

    Hey travis! nice article, a video tutorial and a more comprehensive guide can be found at: http://digitizor.com/2009/03/01/how-to-forward-an-x11-session-to-windows-over-ssh/

    Reply
  • col says:
    July 5, 2009 at 5:45 pm

    helpful post…cheers.

    Reply
  • loobadoobadoo says:
    October 25, 2009 at 8:13 pm

    I found this very helpful but is there a way to use X forwarding even deeper in a lan so that I can access applications that are not on the immediate firewall machine? For example, if I have firewall foo and application server bar behind foo, how can I X forward _bar_’s applications to my local machine? Thank you!

    Reply
  • Tavis J. Hampton says:
    October 25, 2009 at 8:20 pm

    If I understand what you are asking correctly, it looks like you would need to use port-forwarding. Your firewall should have a forwarding configuration that allows you to access an SSH server from outside the firewall. The default SSH port is 22, but you should probably use another one on the outside.

    If that’s not what you need, please clarify.

    Reply
Cancel reply

Leave a Comment




Comment

Please Note: Comments maybe under moderation after you submit your comments so there is no need to resubmit your comment again

write for MTE

Latest Posts

  • OfficeMedium – A Social Collaboration Platform For The Small Business + Free Promotions
  • MakeTechEasier Is Now Hosted On KnownHost
  • KTorrent: KDE’s BitTorrent client
  • How to Create a Customized Toolbar for Your Browser
  • 13 Ways To Customize Ubuntu Netbook Remix For Better Usability

Our Writers

  • Damien Oh - Chief Editor
  • Sharninder - Geeky Ninja
  • Joshua Price
  • Tavis J. Hampton - Lantern Torch
  • Shevonne Polastre - FreeAgentWriter
  • Trevor Dobrygoski
  • Soumen Halder - Ampercent
  • Tanmay Ahmed - Tech-Tips-Geek
Make Tech Easier on Facebook
Jobs by SimplyHired
Job Widgets

Copyright

All the articles (including the text, images and tutorials) are properties of MakeTechEasier.

You cannot copy whole tutorials, either in English or translate to another language without our permission.

Write for us

Writing a tutorial or article for MakeTechEasier is a great way to get exposure and give back to the community.

Read More Details

Suggestions

We need your help to help us serve you better! This is YOUR site, so if you have suggestions/feedbacks on how we can improve it for you, please let us know! We do our best to make this place better!

Make a Suggestion

Navigation

  • Home
  • About Us
  • Advertise
  • Archives
  • Contact Us

Copyright © 2007-2010 Make Tech Easier | All Right Reserved.