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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya @chrishunterjohnsonseal,
By default Droplets come with PasswordAuthentication disabled. As such, I’ll recommend you to add an SSH key for the user.
To do so, you’ll need to go to the user’s Home directory, create a directory called
.ssh
and inside that directory create the fileauthorized_keys
. Inside the file paste the public SSH key for your user.For further details you can check this Docs page as well:
https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/
Hey!
To allow SSH login for the non-root user
ssadmin
, you need to copy the SSH public key from the root user’s.ssh/authorized_keys
file to thessadmin
user’s.ssh/authorized_keys
file.Here’s a step-by-step guide on how to do this:
Login as root:
Create the
.ssh
directory for the new user and set the correct permissions:Copy the root user’s
authorized_keys
file to the new user’s.ssh
directory:Change the ownership of the
.ssh
directory and theauthorized_keys
file to the new user:Set the correct permissions for the
authorized_keys
file:After completing these steps, you should be able to SSH into the server as the
ssadmin
user using the same public key authentication method:Let me know how it goes!
Best,
Bobby