I just bought a raspberry Pi 3. I am trying to run it but first it wrote connection refused
on ssh attempt. After I ran the raspi-config
and enabled the ssh I now get a Connection closed by 192.168.0.31
. When I scan the ports on that machine the 22/tcp
is open (using nmap
).
What could be the problem?
Asked
Active
Viewed 4,965 times
4

durisvk
- 927
- 2
- 12
- 24
-
does the target machine have ssh-server installed? – Amin Etesamian Feb 17 '17 at 19:37
-
the port 22 is open. raspberry pi itself comes with ssh-server, doesn't it? – durisvk Feb 17 '17 at 21:04
2 Answers
8
I just found this solution, now the ssh works:
sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server

durisvk
- 927
- 2
- 12
- 24
0
I was also getting the same problem.
So I tried the following solution.
1. Try to create an empty SSH file without any extension in RPI bootable file.
2. Try to execute sudo systemctl enable ssh
sudo systemctl start ssh
during boot time, using .bashrc
file

Harsh
- 149
- 2
- 11