How To Run Programs Over Secure Shell

A couple of months ago my main desktop computer failed, hardware problems which stopped me from being able to access the gui (graphical user interface) not just in linux but windows 7 aswell. I found however that I could boot into cli (command line interface). This was limiting as I was only able to cli programs. However if I used ssh from another computer I was then able to start some of the gui programs. This is how I achieved this.

On the server (computer having troubles) I made sure that openssh-server was installed in debian/ubuntu sudo apt-get install openssh-server

I then edited /etc/ssh/sshd_config as root with sudo nano /etc/ssh-sshd_config and change X11Forwarding no to X11Forwarding yes. Next I restarted the ssh process with sudo service ssh restart .

On the client I checked I could ssh to the server with ssh -X user@ip.address , logged and ran mousepad just as a test , it worked. Now I knew that I could do that I wanted to stream line it by adding the program I wanted to run into the ssh command , it is done like this ssh -X user@ip.address “mousepad” and was able to enter the password , this was great from terminal and I wanted to use the run command feature of xfce , however I wasn’t prompted for the password so I couldn’t work. The solution to this is to install ssh-askpass, then I was prompted for the password and it worked as expected. The other solution would have been to create ssh-keys without a password like I did here http://sneekygeekers.com/2012/09/11/how-to-connect-to-an-ssh-share-on-boot-using-sshfs. You might find that ssh-askpass looks a bit ugly so there are other better looking options ssh-askpass-gnome, ksshaskpass and razorqt-openssh-askpass, there could also be others I’m not thinking of.

You can even take this a step further by adding an entry to the menu by creating a .desktop file into ~/.local/share/applications/, an example of what the .desktop could look like for mousepad:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Mousepad on Server
Exec=ssh -X user@ip.address “mousepad”
Type=Application
Icon=mousepad
Categories=Network

I was not able to run anything that required 3d accelaration however as my client couldn’t handle that nor receive any sound , there is supposed to be a way to do so using pulseaudio however I never managed to get this working.

Advertisements
Posted in 01Ben, Applications, Authors, Computers, General, ideas and opinions, Interesting, Linux, Other
One comment on “How To Run Programs Over Secure Shell
  1. […] year I posted how-to-run-programs-over-secure-shell, in which I described how to add a menu entry to the menu. In that example I used the Network […]

Please feel free to leave a reply.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 69 other followers

%d bloggers like this: