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/authorized_keys /home/ftphtml/.ssh/authorized_keys nano /etc/ssh/sshd_config Added: AllowUsers ftphtml root Uncommented: AuthorizedKeysFile %h/.ssh/authorized_keys service ssh restart
But when I try to login to ftphtml it gives the following error:
Server refused our key
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!
I’ve fixed the issue by adding the following lines:
chmod 755 /home/ftphtml/.ssh/ chmod 644 /home/ftphtml/.ssh/authorized_keys
But WHY is ALL that necessary just to login using a new SSH user? Shouldn’t DO droplets’ default settings make it easier for us? This is the full list of instructions allow an existing user to SSH:
cp /root/.ssh/authorizedkeys /home/ftphtml/.ssh/authorizedkeys nano /etc/ssh/sshdconfig Added: AllowUsers ftphtml root Uncommented: AuthorizedKeysFile %h/.ssh/authorizedkeys chmod 755 /home/ftphtml/.ssh/ chmod 644 /home/ftphtml/.ssh/authorized_keys service ssh restart
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.