i tried to ssh root@ipaddress. I received error port 22 connection refused
i tried to ssh root@ipaddress. I received error port 22 connection refused. Can you help with this?
Have you changed the port of the SSH server? If yes, then you need to change on the client too, meaning connecting with
ssh -p 22 root@domain_or_ip
Maybe you activated the firewall, but forgot to allow port 22?
This means you're locked out. You can go to the control panel of DigitalOcean and access your droplets console, where you can allow port 22 thru the firewall with this command:
sudo ufw allow 22
Or you have a IPS like fail2ban, which has blocked you for some reason. Go to the console and restart fail2ban, which normally clears any blocking:
service fail2ban restart
To login via SSH, you'll need to get your Droplet's Public IPv4 address from the DigitalOcean Control Panel. You'd then login using either:
or, if you're using SSH Keys:
ssh root@droplet_ip -i /path/to/private_key
/path/to/private_key is the direct path to the private key that's associated with the public key that should be in
~/.ssh/authorized_keys on your Droplet.
The above works if your on a Mac or Linux box using Terminal or another similar application. If you're on Windows, you'll need to use PuTTy or something similar and create a session as PuTTy doesn't work like a standard Terminal application does (in terms of how you login) -- at least not the GUI version.