Enable Secure Shell (SSH) On Your Raspberry Pi

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 latest Raspbian image enables SSH by default so Methods 1 & 2 below are not required if you are using this image. The raspi-config utility can also be used to enable/disable SSH if required.

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.

This entry was posted in Software, Tutorials & Help. Bookmark the permalink.

3 Responses to Enable Secure Shell (SSH) On Your Raspberry Pi

  1. Reader says:

    Thanks for the post. You have a mistake in your post for Method 2. You have ‘Rename “boot_enable_ssh.rc” as “boot.sh”‘. That’s the wrong file extension. It needs to be “boot.rc”.

    After following your directions ssh was still not working. I happened to look inside the file boot.sh file and it says in the top comments ‘Name this file as “boot.rc” and put it on the boot partition’.

    Please update your post for others. Thanks for the lead.

    Happy Pi’ing! :)

  2. mili says:

    If you are using ssh in the open web, you should also take precautions regarding the security of your pi. Here is a short tutorial on how to keep your SSH connection save:
    secure your raspberry pi’s ssh connection

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>