18

I have a raspberry running raspbian, and I want to connect over SSH, but something is happening.

On the raspberry I have run nmap and port 22 says: OPEN; the ssh process is running and fine.

But I can't connect from my windows 8.1 machine with putty, I just get connection refused.

Can anyone give me any pointers?

Edit: forgot to mention that I can both ping it and I have checked raspi-config, and it seems normal.

I had some trouble resolving dependencies with apt-get, but I reinstalled resolvconf, and that fixed it.

EDIT2: It also didn't work while disabling the Windows Firewall.

EDIT3: I can ssh the pi from the pi.

EDIT4: I just found out that my raspberry and windows box have the same ip... what?

Ghanima
  • 15,958
  • 17
  • 65
  • 125
ptf
  • 359
  • 1
  • 3
  • 10

4 Answers4

14

Raspberry changed something since November 2016

here is the noob instruction to get this problem fixed

sudo su
raspi-config

1) Choose first 'update'

2) In advanced options -> expand_root file system

3) interfacing options -> ssh [enable]

4) change_locale [your country-UTF8] and if you still here, it's good to change the timezone as well

5) change the default password (don't be lazy, just do it :)

Richard de Ree
  • 282
  • 3
  • 10
3

So, I figured it out.

A long time ago I assigned an IP to my pi on the router, binding its mac address to the IP.

It so happened yesterday that I had the same IP when I needed the pi again. So I probably tried to connect to my windows machine from my windows machine because of the identical IP's.

What fixed it was this in cmd (on my windows box):

ipconfig /release

ipconfig /renew

yay, finally

ptf
  • 359
  • 1
  • 3
  • 10
1

It might be an issue with wrong SSH key pair matching. Your client stores SSH keys of previous sessions. So if you've SSH'ed in the past with this same client to another device (or same Raspberry but with different build) on the same IP, the keys on both sides don't match. Solution: delete the keys on your client.

Putty stores SSH keys in the registry: HKEY_CURRENT_USER\SoftWare\YOU\PuTTY\SshHostKeys. If you aren't using Putty have a look at %USERPROFILE%\ssh or %USERPROFILE%\.ssh. If you're using OSX, have a look at ~/.ssh/known_hosts

EDP
  • 1,691
  • 1
  • 14
  • 24
0

It might be the windows firewall that is blocking the outbound ssh connection. Make sure port 22 is allowed out of your windows machine.

berto
  • 1,251
  • 1
  • 9
  • 12