RPi Remote Access

Back to Beginners Page

Remote Access to the Raspberry Pi
A default install of a Rpi will probably have an ssh daemon running. This means that the board is listening on port 22 for a remote host asking for a connection. You can run a command line, file transfer or GUI over a port 22 connection to the Rpi.

=Running a remote CLI= You need to have a ssh client program. linux and mac already have this installed for windows get Putty or an alternative. Note: If you use a Windows program to do this stuff then please add some documentation somewhere on the wiki and also bear in mind that you may need to read the manual.

In order for this to work you must have port 22 open between you and the Pi. You must also have set up a user on the Rpi to use. (see beinners page or CLI page for how to do this)

If you are using a cli on linux or mac then just do

ssh  -l 

Here is a record of what happens with me

[brian@fc16toshiba ~]$ ssh -X 192.168.1.104 -l brian The authenticity of host '192.168.1.104 (192.168.1.104)' can't be established. RSA key fingerprint is 26:a4:a1:ab:c2:ff:50:99:d7:e1:49:6e:f2:90:fb:90. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.1.104' (RSA) to the list of known hosts. brian@192.168.1.104's password: Linux raspberrypi 3.1.9+ #9 Mon Apr 9 20:50:36 BST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.

brian@raspberrypi:~$

At this point you are running everything you type on the Rpi.

=Running a remote GUI=

To do this, you need an X server on your machine. There is a free one available for Windows and Mac.

Two Xservers for Windows are Cygwin (which has a lot more besides) and XMing

For a Mac, I believe you get one if you install Gimp on your Mac (if there isn't one already in your OSX)

Linux has one built in.

The command uses the X switch to tell ssh to send the X commands to the X server on your host. ssh -X  -l 

What is an Xserver?

A 'nix box running a GUI is almost certainly running "X" and also an X Server. The X sends commands to the X Server about what kind of things to put on the screen and the X server does it. This means that the GUI and the X server are separate. This also means that you can run a program on the Rpi and have all the graphical bit appear on the screen of the X Server somewhere else on the network. This removes a large amount of processor demand from the Rpi as well as meaning that you just nbeed to plug the Rpi into your network and you need not plug in usb devices and hdmi as well.

Here is a record of what happens with me when I run the command. Log in and then run "midori" which is the browser on this Rpi. (The "&" means that the "midori" is launched as a separate process so you get your cli back).

[brian@fc16toshiba ~]$ ssh -X 192.168.1.104 -l brian brian@192.168.1.104's password: Linux raspberrypi 3.1.9+ #9 Mon Apr 9 20:50:36 BST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed May 30 09:29:57 2012 from fc16toshiba.local brian@raspberrypi:~$ midori & [1] 5773

Sometimes you will get gtk errors which report library shortcomings on host (the Rpi) or server (Your X server) but the process is pretty robust.