I just got a RPi 3 model B and installed Raspbian on it. Using built-in WiFi, I connected it to my router and was able to download and install TightVNC. I installed RealVNC on my laptop and was able to connect to it with 192.168.1.14:1 address. This means that I should be able to connect through SSH as well.
I am able to ping from laptop to RPi, and with Windows firewall OFF I can ping from RPi to the laptop.
I then installed PuTTY on my laptop and (Running as Admin) tried to connect to 192.168.1.14 (all else left default) and got an error immediately with Windows firewall ON or OFF.
I get "Network error: Software caused connection abort" with Windows firewall ON:
and "Server unexpectedly closed network connection" with Windows firewall OFF:
(I guess, for now, ignore the message that comes up when the firewall is ON)
Console Logs read (had to type it out):
pi@raspberrypi:~ $ sudo service ssh status -l
Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
Active: active (running) since Thu 2016-12-29 21:37:51 UTC; 3h 13min ago
Main PID: 506 (sshd)
CGroup: /system.slice/ssh.service
|-506 /usr/sbin/sshd -D
Dec 29 21:37:52 raspberrypi sshd[506]: key_load_public: invalid format
Dec 29 21:37:52 raspberrypi sshd[506]: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 29 21:37:52 raspberrypi sshd[506]: Server listening on 0.0.0.0 port 22.
Dec 29 21:37:52 raspberrypi sshd[506]: Server listening on :: port 22.
Dec 29 21:37:52 raspberrypi sshd[506]: key_load_public: invalid format
Dec 29 21:37:52 raspberrypi sshd[506]: Could not load host key: /etc/ssh/ssh_host_dsa_key
Dec 29 21:37:52 raspberrypi sshd[506]: key_load_public: invalid format
Dec 29 21:37:52 raspberrypi sshd[506]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 29 21:37:52 raspberrypi sshd[506]: key_load_public: invalid format
Dec 29 21:37:52 raspberrypi sshd[506]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
I tried disabling SSH in 'sudo raspi-config' in "Interfacing Options" and rebooting, then re-enabling it and rebooting.
If this is a special case, would reinstalling the OS help?
Thanks!
Edit1: I just checked, I get "Server unexpectedly closed network connection" with Windows firewall ON or OFF.
/etc/ssh
directory withsudo mv /etc/ssh /etc/ssh.backup
then deleting the directory withsudo rm /etc/ssh
and then either restart the sshd service or just reboot the RPi withsudo shutdown -r now
./etc/ssh
. You can clean install OpenSSH usingsudo apt-get purge openssh-server; sudo apt-get install openssh-server
.