5

I have just installed the 2012-09-18-wheezy-raspbian onto SD and plugged it into my pi. According to this question, SSH should be enabled by default. I can see the pi on the network (it responds to ping) and if I do nmap:

nmap -p 22 --open -sV 192.168.0.12
Starting Nmap 5.21 ( http://nmap.org ) at 2012-10-24 20:29 BST
Nmap scan report for 192.168.0.12
Host is up (0.00063s latency).
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 6.0p1 Debian 1 (protocol 2.0)
Service Info: OS: Linux

but when I try to ssh:

ssh -p 22 pi@192.168.0.12

I get

Read from socket failed: Connection reset by peer

I haven't got a suitable monitor so it's pretty hard to diagnose the problem. I checked an the symlinks to /etc/init.d/ssh are already in the runlevel directories as /etc/rc$i.d/S02ssh for i={1..5} (as per this answer). Any other ideas?

tdc
  • 153
  • 5

1 Answers1

3

It appears that the host key files are missing or corrupt. To correct it try this.

sudo rm /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server

ref: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=27&t=15814

Steve Robillard
  • 34,988
  • 18
  • 106
  • 110