How you’d go about setting it up really depends on whether you’re trying to set it up for
root or for a non-
root user. The steps are almost the same, but differ slightly.
For example, for
~/.ssh already exists so it doesn’t need to be created. For all other users, it does and you need to set proper permissions on those directories.
That being said, the easiest method of deploying SSH keys is to simply deploy them with the server so that you don’t need to physically add the initial one (for the
How you log in also depends on your OS. If you’re on MacOS (or OS X), then you’d run:
ssh user@server_ip -i ~/.ssh/private_key
user is the username (such as
root or the user you created),
server_ip is the Droplet IP, and the path at the end,
~/.ssh/private_key, is the path to your private key that was generated when you created your key pair.
If you’re on Windows, it’s a little different depending on what you use to log in. Most commonly, PuTTy is used, which requires that you convert the OpenSSH key to a PuTTy formatted key, and then use that key to login. It’s an extra step, but many programs use PuTTy key format (such as FileZilla).
So my first question would be, what OS are you using (MacOS or Windows)?
Next, what program are you using to try to login, Terminal (Mac OS), PuTTy, or something else?