Edit ssh config and disable root logon via ssh :
sudo vi /etc/ssh/sshd_config
and set “PermitRootLogin” to no.
If you get an error about the ssh_host_dsa_key or ssh_host_rsa_key not being found, generate the keys and try again
Starting OpenBSD Secure Shell server: sshd
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
Generate host keys :
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
Start sshd (“sudo /etc/init.d/ssh start”)
If you want to enable ssh to start at boot time, run update-rc.d ssh defaults
I keep getting the error:
Permissions 0644 for NameOfKeys are too open…
This private key will be ignored
And when I try to connect I get Connection reset by peer
extremely helpful…i have been trying it for 3 days but was getting stuck at the key generation error..finally resolved it.
Key generation solves the problem. Thanks.