Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Raspberry Pi model B at home, but I do not have a screen. My plan is to connect it to the Ethernet and then ssh into it. But this means that the SD card with the operating system (Debian Squeeze) has to be prepared first. I see two ways:

  1. Prepare the SD with the OS such that the RPi always connects to the Ethernet under a fixed IP address and enables an SSH server.

  2. Prepare the SD with the OS such that the RPi connects to the network, enables an SSH server and then broadcasts its IP address so that I can ssh into it.

Which of these ways is easier? And how do I do it? Are there other ways?

I have the following tools: Ubuntu 10.4, MacOS 10.5, Windows 7, but only the Ubuntu has a cardreader. Unfortunately I cannot access my router's DHCP table, it is completely closed.

share|improve this question
Useful aside - RasPi doesn't naturally boot (Debian, at least) with SSH enabled. You need to modify a file in /boot/ that has SSH in its name to boot. I know this doesn't answer your question but it may be the next stumbling block :) – George Pearce Jun 12 '12 at 20:47
ok, that is right. I will add it to the question, since it is a part of the problem. – Till B Jun 12 '12 at 20:51
I do not feel this is worthy of being an answer but you could try a port scanning tool. – ian.shaun.thomas Jun 13 '12 at 11:04
@iampearce: In the debian wheezy beta, ssh does now appear to be enabled by default. – Jon Egerton Jul 5 '12 at 11:11
The current wheezy has SSH enabled per default. If you have a DHCP server in your network, it will work out of the box. – Sentry Oct 15 '12 at 11:56

14 Answers 14

up vote 48 down vote accepted

To enable ssh at startup, backup boot.rc on the boot partition on the SD image and replace it with boot_enable_ssh.rc

I don't know about your router, but you may be able to configure it to reserve a fixed IP address for the MAC address of your Pi.

share|improve this answer
Is ssh already installed on the Debian Squeeze image supplied by the foundation? – Till B Jun 13 '12 at 11:37
@TillB, it is installed in the supplied image, but it must be started manually. – finnw Jun 13 '12 at 16:29
ok, which is the boot partition? I have one that contains the file system, one swap partition and one that contains the start.elf file and others. There is also the boot_enable_ssh.rc, but no boot.rc. I renamed it to boot.rc and booted. I find the RPi in the network (at least I assume that it is the Pi), but ssh is closed. – Till B Jun 14 '12 at 17:12
Are you sure it's that way round. Mine works by renaming TO boot.rc, as found in raspberrypi.stackexchange.com/questions/606/… – David Sykes Jun 23 '12 at 10:24
I booted the 2012-09-18-wheezy-raspbian.img image on a new headless Raspberry Pi, it autostarted sshd and configured itself using DHCP. – nos Sep 29 '12 at 13:51
  1. Copy boot_enable_ssh.rc to boot.rc from /boot in the Raspberry Pi's rootfs (SD card)

  2. Still in the Raspberry Pi's rootfs, edit /etc/network/interfaces in order to have a fixed IP address assigned (so no DHCP server is needed). For example,

    auto lo eth0
    iface lo inet loopback
    iface eth0 inet static
  3. Boot your Raspberry Pi, use an Ethernet cable to connect it to the same network that your PC is connected to (or connect it directly to your PC) and login via SSH:

    ssh pi@
  4. Install a light VNC server in your Raspberry Pi:

    sudo apt-get install tightvncserver
  5. Then start the VNC server (you'll be asked to set a password):

    vncserver :1 -name RasPi -depth 16 -geometry 1024x768
  6. Install a VNC client in your PC:

    apt-get install xtightvncviewer
  7. Then connect to your Raspberry Pi via VNC from your PC:


It just works here in that way :)

share|improve this answer
FWIW: OP asked about ssh - not about X or VNC. – Brad Mar 14 '14 at 17:32
i have used raspberrypi_defconfig configuration under BUILDROOT to mount the OS on the pi ... There is no boot.rc file in boot folder !!! what can i do ? – Frankenstein Jan 24 at 13:08

None of the boot_enable_ssh.rc stuff exists in current Raspian builds. You boot, a nice graphical menu gives you some options (including whether SSHD should load at boot) and then dumps you out on a command line.

That's great if... you're a graphical user.

If you're not, you're left in the position where you have to somehow externally run update-rc.d. All this really does is create a symlink to the /etc/init.d/... script at various points in the /etc/rc{0..6}.d/... filesystem. Confused? Never mind — doing the damage is simple.

  1. I'm assuming you're doing this from a Linux computer. At least something using bash, or something compatible. What I'm suggesting will not work from Windows without Cygwin (or other). Mount the SD card and cd into it.

  2. Run:

    for i in 2 3 4 5; do sudo ln -s /etc/init.d/ssh etc/rc$i.d/S02ssh; done
  3. Unmount, and boot. You should have access to it over SSH.

If you're struggling to find it on your network...

Three options for you:

  • Use your router's admin to find it. Netgear is especially good at showing "Attached Devices".
  • Plug a monitor in and run ifconfig (cheating!)
  • Use nmap on another computer to scan for it. You should know what IP it roughly has (to a /24) so scanning is simple:

    sudo nmap -sV --open  -p22
share|improve this answer
Awesome, this worked! – tdc Oct 26 '12 at 9:07
Don't use nmap for this, you can ping the broadcast address and check the ARP table. – Tom Wijsman Nov 29 '12 at 23:22
@TomWijsman Do you mean running ping -b 192.168.0 or an equivalent? I'm not sure how viable this as I've just tested this on two routers without success. Seems to be commonly blocked. – Oli Nov 30 '12 at 0:04
@Oli: No, it's your kernel that is not gathering all ARP replies, it's considered a waste to check every incoming packet to see if its MAC is already in the ARP cache which is why this doesn't always work on Linux, if only I knew how to configure this; but this for instance works just fine on Windows and Mac OS X... – Tom Wijsman Nov 30 '12 at 0:25
@nornagon: arp -a does not do this on its own. – Tom Wijsman Nov 30 '12 at 6:44

If you use Arch Linux distribution, you just plug it in and wait for it to get its address assigned from a DHCP server. You can then check the DHCP's status (by connecting to your router for example) and retrieve the IP address from connected clients list. If that fails, you can use nmap or similar tools to scan the entire subnet for open port 22 (SSH is enabled by default).

share|improve this answer
oh, forgot to add: I can't access my router (it is supplied by my company and completely closed). Are you saying that on Arch ssh is always enabled? How about Debian? – Till B Jun 12 '12 at 20:55
I think that only Arch comes with SSHd pre-enabled. – Tibor Jun 12 '12 at 20:56
Debian does not have SSH enabled by default. – Steve Robillard Jun 12 '12 at 21:29
So far every distro I have installed on my Pi has had SSH enabled by default. Not saying this is always the case, but it has been for me. – DaveJohnston Jun 27 '12 at 12:52

Using the Debian 7 (Wheezy) beta image, SSH is installed and enabled by default. You just need to connect to it via its IP address.

There are a few ways to work out what IP address the Raspberry Pi is on without having to run ifconfig on it directly, for example:

  • Your router configuration pages may have a screen stating IP addresses for machines connected
  • Most smartphones have free Wi-Fi network scanners that will show devices connected to a network.
share|improve this answer
It is not enabled on MY Debian Wheezy image by default... :( – Matt Oct 31 '12 at 14:03
@Matt: Are you sure? - the standard one I downloaded way back when had it turned on. – Jon Egerton Oct 31 '12 at 14:17
I think so. I just tried it again this morning (with the latest image). Maybe I missed something, but I remember doing this a couple times now. – Matt Oct 31 '12 at 14:27

The easy way (if you have just a keyboard)

SSH is not enabled by default in Debian Wheezy (Raspbian). Once upon a time, SSH was definitely not enabled on my Raspbian images. Apparently SSH is enabled by default now. But if it's not and you're stuck, read on:

Enabling it is very simple, a lot simpler than most of the answers I've seen here, if you have a USB keyboard:

  1. Plug in the keyboard and boot the RPi
  2. Wait a minute, then type "pi", hit Enter, then "raspberry", and hit enter.
  3. Enable SSH with:

    sudo /etc/init.d/ssh start
  4. Type the password "raspberry" again just in case, since it's a sudo command, and hit Enter.

You should now be able to remote into your RPi by its IP address on your network.

As Denis Mitropolskiy mentioned, the configuration utility makes it easy to configure SSH at this point:

sudo raspi-config

Just go to the "ssh" option. Fortunately, this works in an SSH session, so the only command you need to run "blindly" is the first one above.

share|improve this answer
Awesome answer, however it looks ssh might be enabled on the more recent SD cards tht ship with the Pi. Ordered mine last week and ssh just worked out the box! – pufferfish Nov 9 '12 at 14:46
They ship with SD cards now? Where did you order yours? That's good news, though. I was thinking of upgrading to the B model. – Matt Nov 9 '12 at 15:06
Well, it's an option. I ordered my board without one but never got round to creating it myself. Eventually placed another order for just the card – pufferfish Nov 9 '12 at 15:23
Just a comment to this blind solution: I don't have "native" english keyboard (it is slovenian!), so without raspi-config or dpkg-reconfigure keyboard-configuration my USB keyboard sends 'z' instead of 'y', which does affect blind password login. Similar problem can also persist on other non-english keyboards! You can check default english characters in Windows when switching your keyboard/Language bar settings from 'your language'->'EN' in taskbar. – TomiL Oct 16 '13 at 17:09
@TomiL: good point. On German keyboards 'Z' and 'Y' are also swapped. – Peter Mortensen Jul 6 '14 at 18:51

Can't say whether or not SSH works out of the box, but the latest configuration utility version has "Enable SSH" command. After that I was able to connect to my Raspberry via network . But to enable it you need a monitor anyway.

share|improve this answer
This is basically the easiest way. You don't even need a monitor to enable it if you have a keyboard. It only takes one command which you can run blindly. – Matt Oct 31 '12 at 14:19

One caveat: With Arch Linux, this worked for me only if I had Ethernet hooked up before booting the Raspberry Pi (and then it worked fine: sshd was enabled by default). If I first boot, then connect the Ethernet cable, the Raspberry Pi never contacts the DHCP server to get an IP address.

share|improve this answer

If you use Debian, then it's quite easy if you can lend a screen and network for your RPi for just some minutes from a friend. If not, you could just test the commands for 'nmap' and 'ssh' from your Ubuntu host.

Just check that the package openssh-server are installed, and you are up and going. You do that from the command line with aptitude install openssh-server. You could also check or rename the RPi when your are logged into the machine. You could also check that the package avahi-utils and avahi-daemon are installed, just try aptitude install avahi-utils.

The avahi package/program will implement Apples protocoll mDNS/DNS-SD which will announce itself to other computers that uses that protocoll as a computer in the DNS domain local. So if your machine is called rpi-machine, try to connect to the machine with rpi-machine.local.

You could check in the file /etc/nsswitch.conf to see if you have this line there:

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

Both your Apple and Ubuntu machine should implement this. Your MS Windows 7 machine doesn't do that though. On the Ubuntu machine you could try this command:

avahi-browse --all


avahi-browse _ssh._tcp

You should then get all your machines and their services, like SSH and HTTP listed.

You could also try to install the package nmap in your Ubuntu machine. Then can you check which net you are on with the command ip route list to see which IP-net you are on. For example on my machine I could get something like this (this is from example.com, so don't use it): dev eth0  proto kernel  scope link  src  metric 1

tells me that I am on net and the router are So if you run the command nmap will try to find all machines in your net and tell which ports are open. Look for port 22/tcp, as that are the ssh servers.

share|improve this answer

I did manage to setup my Raspberry PI without Screen or Keyboard using the following steps:

  1. Download the latest image of debian-pi/raspbian-ua-netinst. The current one is raspbian-ua-netinst-v1.0.7.img.bz2. The downloaded file is only about 17 MB.

  2. Download the "Apple Pi Baker App" and use this software to transfer the image onto your SD Card


  3. Insert the SD Card into your PI and after approx 15 Minutes the latest Raspbian will be installed.

  4. Using the Fing iPhone App I discovered the IP of the PI, which is in my case


  5. Now I can SSH to that IP like so:

    # Password = raspbian
    ssh root@ 

And Voila I have access through SSH without doing tedious configuration.

FYI: raspbian-ua-netinst offers more advanced configuration, so check out the Readme if you want to adjust some of those initial settings.

ssh access

share|improve this answer

One of the best ways to connect after the initial configuration is to get avahi-daemon up and running on the Raspberry Pi.

Once you have installed the avahi-daemon on the Raspberry Pi and Bonjour on the host computer, you can simply log in using raspberrypi.local as the hostname. So there is no need for configuring the IP address, either static or dynamic.

To install avahi-daemon on Raspberry Pi:

sudo apt-get update
sudo apt-get install libnss-mdns

And if you have iTunes installed on the host computer, then just enter raspberrypi.local in PuTTY, else install Bonjour from here. Check this tutorial for more information.

share|improve this answer

You might want to give the raspbian-ua-netinst a try: you can find it by clicking here It's the minimal Raspbian unattended netinstaller for Raspberry Pi Models 1B, 1B+ and 2B. No screen or keyboard required. They have an excellent installation manual in the README.md.

Essentially, you just FAT-format an SD-card. Unzip the latest stable release onto it and insert the SD-card into your Raspberry Pi. It takes about 20 to 30 minutes to install a minimum Raspbian installation and then you're good to go. Comes with SSH installed by default. There are some options that allow you to install additional packages and stuff during the initial install. You can also add packages later, obviously.

share|improve this answer


To find the IP address of the Pi, try arp -a.

share|improve this answer
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Tom Wijsman Nov 29 '12 at 23:23
This question is answered sufficiently elsewhere in this thread; the main new piece of information I wanted to add was arp -a. – nornagon Nov 30 '12 at 5:36
Which does exactly nothing because you don't add details to what it is and how it works. – Tom Wijsman Nov 30 '12 at 6:43

I've writen a little tutorial for my friends about this here, if you like. There are also some basics about networking. But it's on Archlinux ARM, where is SSH enabled by default.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.