I would like to have a secure Ubuntu server. I believe the best way to accomplish this is to only use SSH keys and disable use of the root user account. Accomplishing this is not made easy. The tutorials either show you how to use SSH keys on root or how to use a second account with a password, not a combination of the two. I have tried to do both and failed. The following is what I have attempted to do to accomplish this task.
Create Ubuntu droplet with SSH keys in DO panel.
Login to root using SSH key and create secondary user.
Paste the SSH key into the secondary users' ~/.ssh/authorized_keys file.
Either disable root login or require SSH keys: PermitRootLogin No || without-password
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.