First: understand the fundamentals of what is supposed to happen.
A SSH client process on your Windows desktop is supposed to connect to TCP port 22 on the DigitalOcean VM. Once a connection is established, it should authenticate as user root using a SSH key.
That means you don't need sshd (or "ssh service") on your desktop: it would be needed only if you wanted to allow inbound SSH connections to your desktop.
You're getting "connection refused". That means one of the following:
- you might not have the correct IP address for the cloud VM (with cloud VMs, the local IP address the VM sees internally might not be the same as the address presented to the internet by the cloud infrastructure)
- your local network might require the use of a proxy to access services outside the local network (common in workplace networks)
- the Digital Ocean VM might not be running at all
- the VM's firewall in the cloud might not be allowing incoming SSH connections until you specify the allowed source IP addresses
- you might have to use Digital Ocean's web UI/API to enable the SSH service on the cloud VM.
Once you can establish a basic TCP connection to the VM's SSH port, you can proceed to troubleshooting the authentication.
Allowing password-authenticated logins on a cloud VM is a very bad idea if access to the SSH port is not restricted to known IP addresses only: there are hacked servers and automated malware that will spend all their time scanning the internet for SSH-enabled hosts and attempting to bruteforce any well-known user accounts, including root.
sshd (the SSH service) even has a special setting that can force direct logins as root to either always be rejected, or to accept key authentication only, even though password authentication may be enabled for other users. Use of that setting is strongly recommended for cloud services.
If a VM is maintained by several people, logging in using a personal user account and then using sudo makes it easier to use the logs to find out who-did-what if it ever becomes necessary. A cloud provider may require that you use a particular user account that is not root for initial login; once you successfully connect for the first time and get your root access, you can obviously configure the VM as you see fit.
Often, a cloud provider will give a pre-generated SSH private key for initial SSH access to the VM. There are a few possible key file formats: a *.ppk file is for PuTTY, a common free Windows SSH client (nowadays also available for Linux), while id_* with no specific suffix is for OpenSSH. Usually the keys can be converted from one format to another using the respective key generator tools (like PuTTYgen keyfile.ppk -O private-openssh -o id_openssh for converting *.ppk files to OpenSSH format).
If you are using WSL's command-line SSH client, that is a form of OpenSSH. Normally OpenSSH looks for default private keys in the .ssh sub-directory of the local user's home directory (named id_rsa, id_dsa, id_ecdsa, id_ed25519 etc. according to the algorithm used). If any of those private key files exist, the client will automatically offer them to the remote server if it allows key-based authentication.
On WSL, the location of the Unix-style home directory might not be so obvious, so you might want to use the -i option to explicitly specify the private key file to use.
When using key authentication, you must still specify the correct username, so the SSH command might look like:
ssh -i /some/where/id_digitalocean_privatekey [email protected]
ssh -v) and server (configuration file, or runsshddirectly with options, and not as service).