Question

ssh_exchange_identification: Connection closed by remote host

Posted September 1, 2013 16.5k 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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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 : https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-nginx-in-ubuntu-18-04 . 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.
Submit an Answer