Access Remote GUI Programs Using SSH Forwarding

FAIL (the browser should render some flash content, not this).

Run GUI apps on another machine remotely through SSH.

Download in .ogv format

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Root + SSH = No Go!

Anonymous's picture

You really shouldn't allow root to login remotely!

That even counts double if you're using plain old password to log in!

You get much more security if you use ssh keys to login and don't allow root to log in remotely. Instead, log in as a normal user and use the command "su -" or "sudo" to become root *after* you have logged into the remote machine.

Last, but not least, don't use port 22 for ssh. Set sshd to listen to some other port > 1024.

I like it! shows that linux

Easteregg's picture

I like it! shows that linux has something to say :D

The first time i ran the

Anonymous's picture

The first time i ran the command it just worked.. I was really impressed. My server has a 5Mbit upload, so the performance was not bad at all..

however, the next day, and every day since i get the following error when i try the command.

(gnome-terminal:27725): Gtk-WARNING **: cannot open display:

CentOS 5.3 Final

Display Linux apps on a Windows desktop too

copsewood's picture

I found out how to make a Windows desktop display Linux apps also using the remote X display protocol a couple of weeks ago. The SSH client to use on Windows is Putty and you need to set this in X forwarding mode, and also have the Xming X server on Windows running in multiwindow mode.

If the Linux server is on a broadband connection, you will probably need to forward the SSH port to it from the router/firewall. If the server is running Ubuntu, make sure you run the command:

sudo aptitude install openssh-server

to install and run the SSH server on it too.

Oh and BTW, good idea to install denyhosts or similar on the ssh server to defeat password guessing attacks.

ssh -C server2@address -p

headlice's picture

ssh -C server2@address -p gnome-terminal

Outputs this:

Failed to contact the GConf daemon; exiting.

server setup

David Murch's picture

To setup a machine to connect to with SSH forwarding simply do the following (ubuntu + SuSe:

make sure to install the package openssh-server on your distro

> vi /etc/ssh/sshd_config

and set:
X11Forwarding yes

> vi /etc/ssh/ssh_config

and set:
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes

> /etc/init.d/ssh restart

Your done and con connect with forwarding

I see a red arrow on the top

The Other Richard's picture

I see a red arrow on the top bar. Don't forget to install your updates.

Yes, this is great for LAN not so much for WAN. But for WAN, ssh to a command line is not so hard. Don't fear the command line. After the learning curve you can accomplish more in quicker time.

And yes, this is from someone who on WinXP has evolution open on a linux box and another ssh xterm shell open to control a OSX box. :)

Thats fascinating but what

Anonymous's picture

Thats fascinating but what is required to get that up and running, i.e maybe instead of showing us to use a feature explain how it is setup i.e. how to enable/configure X forwarding, or am to understand that this is just a teaser?

GX

Cool

madspaz's picture

Been using !NX for some time now to get a remote X session; not quite as simple but with Debian it can be a 3 click process (using the .deb files, literally up and running in 5 minutes) once OpenSSH is installed. Great tip none the less; yes it is slow but more than enough in a bind.

local network will not work

terry's picture

I used a ip from a laptop on my local network with this command

( ski@ubuntu:~$ ssh -C -X ski@192.168.X.XXX )

also tried root before the @ sign.came back as

ssh: connect to host 192.168.x.xxx port 22: Connection refused

NOTE :I blocked my local ip with XXs for example only.

SSH?

Shawn Powers's picture

Perhaps SSH isn't running on your server?

Shawn Powers is an Associate Editor for Linux Journal. You might find him chatting on the IRC channel, or Twitter

too slow

Jason's picture

This tip is too slow for anything except local area network.

Sorta

Shawn Powers's picture

Yes, over a WAN it is pretty painful to use an application -- but for an emergency configuration or something, it's tolerable over broadband.

Shawn Powers is an Associate Editor for Linux Journal. You might find him chatting on the IRC channel, or Twitter

Sneakiness

Anonymous's picture

What you really need to show people is how to get around corporate firewalls and web filters by using linux on a home computer to act as a proxy both for HTTP/S and for DNS. The same techniques are also handy for safe web access in places like airports, hotels, and conventions.

Just a suggestion.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState