How to SSH into DigitalOcean Droplet
DigitalOcean Cloud Computing. Learn how to securely connect to your server from any browser without installing native terminal apps like PuTTY or Termius.
Connection Quick Reference
- Default Username:root
- Authentication:Password or SSH Key
Droplet IP Addresses and Network Architecture
When you provision a new Droplet on DigitalOcean, it is immediately assigned a static, public IPv4 address. Unlike some other cloud providers (such as AWS, where the IP can change upon stopping the instance unless specifically bound to an Elastic IP), your Droplet's IP address remains constant for the entire lifecycle of the server, from creation to destruction.
To locate this address, navigate to the DigitalOcean Control Panel. Your main dashboard lists all active resources. Find your Droplet in the list; the IPv4 address will be prominently displayed right next to the Droplet's hostname. You can click the IP address to instantly copy it to your clipboard.
If you enabled IPv6 during creation, you will also see an IPv6 address. SSHDock supports both, but IPv4 remains the standard for initial configurations unless your local network is fully IPv6-ready.
Authentication Methods: Passwords vs. SSH Keys
DigitalOcean offers two primary ways to authenticate when you create a Droplet. Your connection strategy depends entirely on which option you selected during the provisioning phase.
Password Authentication
If you chose "Password" during setup, DigitalOcean enforces strict complexity requirements. You created a root password that must be at least 8 characters long and include an uppercase letter, a lowercase letter, a number, and cannot end in a number or special character.
Because password authentication is vulnerable to brute-force attacks, it is highly recommended to disable password logins in the /etc/ssh/sshd_config file as soon as you have successfully logged in and configured SSH keys. However, for your very first connection, this password is required.
SSH Key Authentication (Recommended)
If you chose "SSH Key," DigitalOcean injects your public key into the /root/.ssh/authorized_keys file during the server initialization process via cloud-init.
If you use this method, password authentication is automatically disabled for the root user. If you lose your private key, you will not be able to log in. DigitalOcean does not retain a copy of your private key, and their support team cannot recover it for you. Your only recourse would be to use the web-based Recovery Console to manually reset the root password or inject a new public key.
The Default Root User
Unlike AWS or Google Cloud, which create unprivileged users (like ec2-user or ubuntu) and rely heavily on sudo for administrative tasks, DigitalOcean takes a more traditional approach: you log in directly as the root user.
The root account is the absolute administrator of the system. You have unrestricted access to modify any file, bind to any network port, and execute any command without prefixing it with sudo. While this is convenient for initial setup, it is a security risk for long-term operations. Best practice dictates that your first task upon connecting should be to create a new, limited user account, add them to the sudo group, and disable direct root SSH logins entirely.
Connecting with SSHDock
Connecting to your DigitalOcean Droplet via SSHDock is a straightforward process, eliminating the need to configure native terminal applications like PuTTY on Windows or standardizing the experience across different OS platforms.
- Launch SSHDock and open the new connection modal.
- In the Host field, paste the IPv4 address you copied from the DigitalOcean Control Panel.
- Leave the Port set to the default
22. - In the Username field, enter
root. - Under the Authentication section, choose your method based on your Droplet setup:
- If using a Password: Select the password option and type the complex password you created during provisioning.
- If using an SSH Key: Select the Private Key option. Open your local private key file (e.g.,
id_rsaorid_ed25519) in a text editor, copy the entire block of text, and paste it into the key field. Ensure you include the header and footer lines.
- Click Connect.
On your first connection attempt, SSHDock will display a host key verification warning. This is standard SSH protocol behavior. The client is confirming the cryptographic identity of the remote server. Accept the fingerprint, and SSHDock will store it locally to protect against future man-in-the-middle attacks.
Common Connection Issues
Connection Refused
If the server actively refuses the connection, it means the SSH daemon (sshd) is either not running or not listening on port 22. This is rare for a brand-new Droplet but can happen if you modified the sshd_config file and restarted the service with syntax errors. Use the DigitalOcean web console to log in out-of-band and inspect the service status (systemctl status ssh).
Permission Denied (publickey)
If you receive this error when trying to use key-based authentication, it means the server did not recognize the private key you provided.
- Verify you pasted the correct private key corresponding to the public key you uploaded to DigitalOcean.
- Ensure you are logging in as
root. If you previously created a standard user and disabled root login, you must use that standard username instead.
Droplet Unreachable
If the connection simply times out, there is a network routing issue. Unlike AWS, DigitalOcean does not use external Security Groups by default (unless you explicitly set up a DigitalOcean Cloud Firewall). If it times out, you either have a local network issue blocking outbound port 22, or you accidentally enabled ufw (Uncomplicated Firewall) on the Droplet and forgot to allow SSH traffic before enabling it, effectively locking yourself out.