Faced an issue of unable to connect remotely to my raspberry pi remotely over ssh. Enabled password based authentication etc in sshd_config file. Still the issue not resolved. Below commands assisted in the resolution of the problem.
sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server
sudo systemctl stop ssh
sudo systemctl start ssh