One can start the ssh server using the boot.rc
. Below is an explanation of how that works.
Configuring the boot.rc
Insert an SD-Card with the Debian OS on it back into the machine, you copied over the image on. The operating system of that machine should mount the boot partition which is the first partition of the the SD-card. If it does not try something like this on Linux:
sudo mount /dev/sdb1 /mnt
On the mounted partition you will find a file boot_enable_ssh.rc
, if you installed a recent version of the officially recommended Debian image. Back this file up, if you will and rename or copy it to boot.rc
. To ensure your changes have been written to the SD-card, umount it and wait for the safe remove to finish. When you now boot the Raspberry Pi with that SD-card, it should come up with ssh running.
Finding the Pi and its SSH server
To connect to the Pi you need to gather the IP address of your Pi. This can be done by checking the device list of a router, usually responding under http://192.168.0.1
, http://192.168.1.1
or http://192.168.178.1
. If that is not the case, you can scan your subnet for ssh hosts using nmap
:
$ nmap -p 22 --open -sV 192.168.0.1/24
Nmap scan report for 192.168.0.142
Host is up (0.0094s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 5.5p1 Debian 6+squeeze1 (protocol 2.0)
Service Info: OS: Linux; CPE: cpe:/o:linux:kernel
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 256 IP addresses (2 hosts up) scanned in 3.00 seconds
Testing
The interesting parts of the above output are the IP address and the port.
The IP address is in this case 192.168.0.142
, but can be different for you because it is determined by DHCP.
The port is in this case 22
and that should usually be the case, because 22 is the reserved port for ssh.
With this information, one can test the ssh connection on the raspberry pi using something like this:
ssh -p 22 pi@192.168.0.142
SSH should ask for a password which is raspberry
on current images; for the latest usernames and passwords see the section relevant to Debian of the official downloads page.
192.168.0.142
andssh -p 22 pi@192.168.0.142
returnsssh: connect to host 192.168.0.142 port 22: Connection refused
– Bengt Jun 22 '12 at 13:21sshd
from there. – Bengt Jun 22 '12 at 13:33sshd
installed which I could enable by movingboot_enable_ssh.rc
to theboot.rc
on the 78 MB partition. – Bengt Jun 22 '12 at 14:15