fix ssh file permissions

user@client~$ chown $USER:$USER -R $HOME/.ssh
user@client~$ chmod 700 $HOME/.ssh
user@client~$ find $HOME/.ssh/ -type f -exec chmod 600 {} +
user@client~$ find $HOME/.ssh/ -type f \( -name '*.pub' \) -exec chmod 644 {} +
Assuming that your public key files are named anything ending with “.pub”. Use the find command to recursively (see as well here) set file permissions. This allows you to organize multiple key files into subdirectories within the .ssh folder.
Share itShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *