I all of a sudden cannot connect to my droplet via ssh through Mac terminal. I ran the following:
ssh -vv root@my_ip
And get the following:
MacBook-Pro:~ my_name$ ssh -vv root@my_ip OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: /etc/ssh_config line 102: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to my_ip [my_ip] port 22. debug1: Connection established. debug1: identity file /Users/my_name/.ssh/id_rsa type 1 debug1: identity file /Users/my_name/.ssh/id_rsa-cert type -1 debug1: identity file /Users/my_name/.ssh/id_dsa type -1 debug1: identity file /Users/my_name/.ssh/id_dsa-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.2 ssh_exchange_identification: read: Connection reset by peer
Any ideas?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
How was the Droplet setup? – A one-click image, manually, etc?
Are you using a firewall such as ufw or an IPS such as fail2ban?
If so, you may have been blocked in which case you’d need to login using console and check the logs, and/or disable the firewall or service to see if that’ll allow you back in.
You can access DigitalOcean’s console by logging in to the DigitalOcean Control Panel, clicking on the name of the Droplet, then from the left side menu, click on Access. You’ll see a big blue button that says Launch Console. You’ll need your root password to login.
ufw can be disabled using ufw disable. Once disabled, I normally recommend resetting the rule set and starting fresh. If you’re able to login using Terminal once ufw is disabled, do so, and then run the following (you should be able to copy and paste to Terminal):
ufw reset
Followed by:
ufw default deny incoming \
&& ufw default allow outgoing \
&& ufw allow 22/tcp \
&& ufw allow 80/tcp \
&& ufw allow 443/tcp
Followed by:
ufw enable
The above will reset ufw to a barebones configuration, setup default policies, and then only allow a connection on ports 22, 80, and 443.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.