Enable Secure Shell (SSH) On Your Raspberry Pi

Posted on May 31, 2012 by Matt

Secure Shell or SSH is a network protocol that allows you to run commands on a remote device. In the case of the Raspberry Pi can you execute commands over your network from another device such as a PC or laptop. This allows you to control the Pi without attaching a keyboard, mouse or even a monitor.

The free utility “PuTTY” can be used to connect to your Pi using SSH once it is enabled.

Update : The newer Debian “Wheezy” image enabled SSH by default so Methods 1 & 2 below are not required if you are using this image.

Method 1

To start the SSH server on a Pi you can open a terminal window (i.e. LXTerminal) and type :

sudo /etc/init.d/ssh start

followed by Enter. This needs to be done every time the Pi boots.

Method 2 

To enable SSH automatically every time the Pi starts you need to :

  • Prepare an SD card with the Debian “Squeeze” image
  • Insert the SD card in your PC
  • Rename ” boot_enable_ssh.rc” as “boot.rc”
  • Eject the SD card and insert into your Pi

When the Pi boots SSH is enabled by default.

Using SSH

You can now open a remote terminal window using PuTTY or any other SSH enabled client. This will allow you to type commands as if you were using the Pi directly.

You can even use SSH to transfer files using a file explorer style interface on your PC. I recommend the free utility WinSCP which will allow you to drag and drop. Transfering files is easy and similar to using FTP.