By pnakhat
I already have a droplet setup with SSH key for root. Now I want to add an additional user with limited capability (Someone who can just deploy application on tomcat etc), with the same SSH key. How should I do it?
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!
You could login as the root user on the droplet. After this create a new user (on CentOS: useradd username). After you’ve created the user, login as this user (can be done directly from root: su username).
Now edit the file: ~/.ssh/authorized_keys and paste the public key in this file. Save it and make sure you chmod it to 600. Now you could login as the newly created user with the SSH key.
If you’re unable to login, please check the /var/log/secure login (as the root user) to see why you can’t login. If it says something about not in the AllowUsers, then: nano /etc/ssh/sshd_config and at the end of the file, you could add the user: AllowUser username. Make sure to restart ssh.
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.