Question
Add a new ssh user to a droplet
I created a LAMP droplet on ubuntu.
I set it up so I can login on root using SSH, there is no problem there. However I’ve tried multiple tutorials to add a new SSH user and nothing works. I just want a simple way to add an SSH user by using the same SSH key the root user uses. Is there not a tutorial for that?
I’ve created a user (ftphtml), I want ALL the steps to allow that user to login using SSH, could anyone give me the instructions?
I’ve tried this so far:
cp /root/.ssh/authorizedkeys /home/ftphtml/.ssh/authorizedkeys
nano /etc/ssh/sshdconfig
Added: AllowUsers ftphtml root
Uncommented: AuthorizedKeysFile %h/.ssh/authorizedkeys
service ssh restart
But when I try to login to ftphtml it gives the following error:
Server refused our key
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.
×
I don’t know what you did but all I had to do was literally use the “adduser” command
This is using SSH, you can’t just add a user and login via SSH. If it asked you your password it’s not SSH.