A similar question has been asked before: How to set up Raspberry Pi without a monitor?
However, given that the accepted answer doesn't appear to offer an appropriate solution, and given that there's a level of ambiguity in what was being asked, I'm assuming that the original question was mis-constructed, and that my question isn't an exact duplicate.
I'm performing the initial, first-time set-up of a Pi. I don't have a monitor or keyboard, but instead want to use a connected laptop to do the job. I don't want to buy a monitor or keyboard and have them sitting around just for the occasions when they're needed by the Pi. I could borrow them, but I plan to buy more Pi's in the future, and don't want to have to borrow them each time.
I've set a static IP address on the Pi by editing the cmdline.txt
file. (The Pi is running the lastest version of Raspbian.)
ip=10.0.0.20
I've given the eth
interface on my laptop a corresponding static IP address. (The laptop is running Ubuntu.)
ip ad add 10.0.0.10/24 dev eth0
I've connected the two together with an ethernet cable and can successfully ping the Pi from my laptop.
What I can't do is ssh
to the Pi. I'm getting a Connection refused response:
richard@richard-ThinkPad-X220:~$ ssh -vvv pi@10.0.0.20
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.0.0.20 [10.0.0.20] port 22.
debug1: connect to address 10.0.0.20 port 22: Connection refused
ssh: connect to host 10.0.0.20 port 22: Connection refused
One thing that this would imply is that sshd
is not yet running on the Pi.
The official docs state that sshd
runs by default, but is it possible that during an initial boot that other things (e.g. prompts waiting for user input) might block the boot at a certain level, meaning we don't reach the point at which sshd
is started?
Where do I go from here? (Not "to the shops to buy a monitor"... )
Is what I'm trying actually possible?
Edit:
I've now tried the methods mentioned in the answers to the following post, but without success: Enabling SSH on RPi without screen - keystrokes for raspi-config?
Specifically, ensuring that the SSH init script is run at runlevel 2 still didn't allow me to connect.
ssh pi@raspberrypi.local
You don't seem to think telling us how you actually try tossh
is important. – Milliways Jan 30 '16 at 12:29ping pi@raspberrypi.local
. But this doesn't work becauseraspberrypi.local
is an unknown host. Wouldn't it need an entry in/etc/hosts
on my laptop to be able to resolve it? – Richard Horrocks Jan 30 '16 at 13:23ip route
on the ubuntu box. – goldilocks Jan 30 '16 at 14:29sshd
is running on the Pi? – Richard Horrocks Jan 30 '16 at 14:39sudo nmap 10.0.0.20
on the laptop. If it shows port 22 is open then SSH is running, otherwise it's not running. It won't fix it, but it'll tell you what's happening. – garethTheRed Jan 30 '16 at 16:41nmap
, directing to the specific port:nmap 10.0.0.20 -p 22
. It showed it as closed. (Adding the-Pn
flag actually showed the port as open... ) – Richard Horrocks Jan 31 '16 at 11:12