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.

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.

You can execute these commands after having logged in remotely, and if executed while logged in from a remote client you will not be disconnected mid-session. However, after you generate unique you will need to clean up your client's known_hosts. <ref >http://www.cyberciti.biz/faq/howto-regenerate-openssh-host-keys, see step 3 - Accessed 6 Jul 2012 </ref>

+

+

This extra command (and subsequent follow up to update the cached public key on all clients who've already remotely connected to your Raspberry Pi) may seem like a hassle, but without doing this you leave yourself wide open to a man-in-the-middle attack because your "private" host ID keys are widely available to anyone who has downloaded the same SD card image as you.

=Running a remote CLI=

=Running a remote CLI=

−

You need to have a ssh client program. linux and mac already have this installed for windows get [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty] or an alternative.

+

You need to have a SSH client program. Linux and Mac OS X already have this installed, for Windows get [http://www.chiark.greenend.org.uk/~sgtatham/putty/ 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)

+

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 Raspberry PI to use. (see [http://elinux.org/RPi_Beginners Beginners Guide] or CLI page for how to do this).

−

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

+

===Linux and Mac OS X===

ssh <ip address of your Rpi> -l <username of RPi user you set up previously>

ssh <ip address of your Rpi> -l <username of RPi user you set up previously>

Line 35:

Line 42:

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

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

+

+

===Windows (with Putty)===

+

+

First you need to download [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty].

+

+

====Create a Profile====

+

+

I recommend to create a profile for your connection so you don't need to configure it every time you want to start it.

+

Start Putty and type in the ''Host Name (or IP address)'' field the Raspberry PI's IP address (usually something like 192.168.0.xxx, use "ip address show").

+

If not already set, enter 22 as ''Port'' and select SSH as ''Protocol''.

Now your profile is complete, you can save it under ''Session'' by typing a name for your profile under ''Saved Sessions'' and clicking on the ''Save'' button.

+

+

====Establish a connection====

+

+

To establish a connection to your Raspberry PI simply click on ''Open''. If you can't etablish a connection make sure the SSH daemon is running on your Raspberry PI. For more information check the [http://elinux.org/RPi_Advanced_Setup#Setting_up_for_remote_access_.2F_headless_operation Advanced Setup].

+

+

Usually you will get a security warning, you can simply click on ''yes''.

+

+

====More information====

+

+

Here is an excellent guide for setting up an SSH connection with Putty:

+

http://www.howtoforge.com/ssh_key_based_logins_putty

=Running a remote GUI=

=Running a remote GUI=

Line 42:

Line 72:

Two Xservers for Windows are [http://www.cygwin.com/ Cygwin] (which has a lot more besides) and [http://www.straightrunning.com/XmingNotes/ XMing]

Two Xservers for Windows are [http://www.cygwin.com/ Cygwin] (which has a lot more besides) and [http://www.straightrunning.com/XmingNotes/ XMing]

−

For a Mac, I believe you get one if you install [http://www.gimp.org/ Gimp] on your Mac (if there isn't one already in your OSX)

+

For a Mac, either install [http://www.gimp.org/ Gimp] for Lion 10.7 or earlier or install X11 from [http://xquartz.macosforge.org XQuartz]

Linux has one built in.

Linux has one built in.

Line 48:

Line 78:

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

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

ssh -X <ip address of Rpi> -l <username on Rpi>

ssh -X <ip address of Rpi> -l <username on Rpi>

+

+

In case you are connecting from a Windows machine using Putty then you should enable X11 forwarding, this option can be found navigating the configuration tree through Connection/SSH/X11.

+

+

'''cannot open display: localhost:10.0'''

+

+

if RPi is left idle one needs to reboot to launch new applications that use X11.

+

The ones already displayed work fine.

+

+

A fix and workarounds are of interest.

'''What is an Xserver?'''

'''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.

+

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 need 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).

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).

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.

Initial Setup

Prior to your initial remote access it is recommended that you generate unique host public/private keys with the following command[1]

sudo rm /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server

You can execute these commands after having logged in remotely, and if executed while logged in from a remote client you will not be disconnected mid-session. However, after you generate unique you will need to clean up your client's known_hosts. [2]

This extra command (and subsequent follow up to update the cached public key on all clients who've already remotely connected to your Raspberry Pi) may seem like a hassle, but without doing this you leave yourself wide open to a man-in-the-middle attack because your "private" host ID keys are widely available to anyone who has downloaded the same SD card image as you.

Running a remote CLI

You need to have a SSH client program. Linux and Mac OS X already have this installed, for Windows get Putty or an alternative.

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 Raspberry PI to use. (see Beginners Guide or CLI page for how to do this).

Linux and Mac OS X

ssh <ip address of your Rpi> -l <username of RPi user you set up previously>

Windows (with Putty)

Create a Profile

I recommend to create a profile for your connection so you don't need to configure it every time you want to start it.
Start Putty and type in the Host Name (or IP address) field the Raspberry PI's IP address (usually something like 192.168.0.xxx, use "ip address show").
If not already set, enter 22 as Port and select SSH as Protocol.
Go to Connection -> Data and type your Raspberry PI's username under Auto-Login username.
Now your profile is complete, you can save it under Session by typing a name for your profile under Saved Sessions and clicking on the Save button.

Establish a connection

To establish a connection to your Raspberry PI simply click on Open. If you can't etablish a connection make sure the SSH daemon is running on your Raspberry PI. For more information check the Advanced Setup.

More information

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, either install Gimp for Lion 10.7 or earlier or install X11 from XQuartz

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 <ip address of Rpi> -l <username on Rpi>

In case you are connecting from a Windows machine using Putty then you should enable X11 forwarding, this option can be found navigating the configuration tree through Connection/SSH/X11.

cannot open display: localhost:10.0

if RPi is left idle one needs to reboot to launch new applications that use X11.
The ones already displayed work fine.

A fix and workarounds are of interest.

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 need 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).