By luismuzquiz
When inserting (pasting) a public SSH key on a user’s folder, within a Droplet, Im seeing a lot of people urge to
chmod 700 ~/.ssh
and then to
chmod 600 ~/.ssh/authorized_keys
But if i chmod 600 ~/.ssh/authorized_keys with my user then i am not able to login via ssh, i need to change it to chmod 755 ~/.ssh/authorized_keys in order to connect.
Which leads to my question: Why is so important to have a public key under chmod 600??
And why im not being able to connect with chmod 600 but only with chmod 755?
Thanks in advanced
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!
Ok to answer my own question i was not able to SSH with my user cause i needed to make sure that user owned the files and folders and not root, with:
sudo chown -R user:user /home/user/.ssh
where user = myusername
But i still don’t understand why a public key needs chmod 0600
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.