Please could someone help me to undo this command, I tried for enabling ssh on the pi?:

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

I read that command on this page.

And even though I can see pi on my router's ip pool, it is not connecting to the internet or the ssh on my windows putty. It's connected to my lan network via ethernet. I've never used or known about ssh, and tried it only after buying the pi. I thought it would help in accessing the pi over wifi, since my wireless mouse+keyboard isn't compatible with the pi. I also bought a wifi adapter but since I've to connect both usb mouse and usb keyboard, there's not extra port to attach it.

EDIT: Pinging to the Raspberry Pi in command prompt displays as follows:

IP Address: Raspberry Pi :

IP Address: Win7 (my Laptop):

Pinging with 32 bytes of data:
Reply from Destination host unreachable.
Reply from Destination host unreachable.
Reply from Destination host unreachable.
Reply from Destination host unreachable.

Ping statistics for
Packets: Sent = 4, Received = 4, Lost = 0 <0% loss>.
  • Is your problem that you are unable to use Putty to SSH into your Pi? If yes, can you ping your Pi from your PC? What error or message do you receive when you attempt to connect via Putty to your Pi? Commented Oct 2, 2013 at 12:05
  • The error I'm getting on Putty is : Network Error: Connection Timed Out ... I just pinged the raspberry pi, and have updated my question with the results of the ping.. Commented Oct 2, 2013 at 13:15

2 Answers 2


There are 2 commands splitted by && marks in your example. && means that second command will run if first command is successful.

First command will remove all files in /etc/ssh/ folder which begin with 'ssh_host_'. (* works as wildcard)

Second command will re-configure openssh-server program by Debian way. It will create new ssh_host files in /etc/ssh/ folder.

Those commands used for creating new fingerprints for ssh server. If your OS pre-installed you may want configure ssh-server because you don't want to trust OS maintainer guys :) Server ssh fingerprints are important for device security.

To enable SSH on boot please run 'raspi-config'. In menu you will find 'enable/disable SSH' option.

  • Thanks! I was worrying I had corrupted the ssh settings on the pi! Commented Oct 2, 2013 at 13:19
  • Hey! My problem is still not solved completely! How can I access the pi with ssh, when the Ethernet connection is not connecting to the internet? It's showing on the LAN router, but not accessible via putty... ? Commented Oct 2, 2013 at 17:34
  • First of all ensure that sshd running on Pi. Try that command without quotes, "netstat -tlnp |grep ssh" Commented Oct 3, 2013 at 6:57

Im facing the same problem but only after I've upgraded from wheezy to jessie. I followed already your described steps above without success.

ssh process is started on rpi and listens on

Interesting fact: Ping/ssh from my Macbook to rpi doesn't work Ping/ssh from rpi to Macbook works

Also, I checked the iptables but there are no policies.

  • 1
    This would be better as a comment as it's not really answer to the question
    – recantha
    Commented Apr 20, 2015 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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