ssh_exchange_identification: Connection closed by remote host

September 1, 2013 16.1k views
I did few steps for the gunicorn and nginx. Everything was fine, but, then i again tried to login into vps by ssh then i get following errors. ssh_exchange_identification: Connection closed by remote host Now, i can't login into digitalocean vpn to change /etc/hosts.deny Further, i tried from the browser based terminal access then its wired that i can't type "/" as my keyboard is not in english format. Help is appreciated!
4 Answers
Log in to your droplet via the console and run these commands:

ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key

ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key

if that doesn't work (i.e. you still can't type /), try running this command instead:

dpkg-reconfigure openssh-server
@kamal i can't type "" in DO vnc my keyboard is azerty
@kamal thank you it is fixed i can connect to ssh

thank you soo much

After creating self signed cert, using this tutorial : . i have tried all the solutions presented and i still get same error ‘sshexchangeidentification: read: Connection reset by peer’

by Brian Boucheron
In this guide, we will show you how to set up a self-signed SSL certificate for use with an Nginx web server on an Ubuntu 18.04 server.
Have another answer? Share your knowledge.