How to sync *.ssh keys and set permissions

Assalamualaikum wbt and greeting everyone! I’ve had the same ssh keys for years. I just rsync them to a new system when I get one. The problem is I always seem to end up with mucked up permissions moving them around and never seem to remember how the permissions were set. Now let put some note as my future reference here.

$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/authorized_keys
$ chmod 644 ~/.ssh/config
$ chmod 600 ~/.ssh/id_dsa
$ chmod 644 ~/.ssh/
$ chmod 644 ~/.ssh/known_hosts

It should be okey and worked!

Update : Another great tips from mcepl is to use chmod 600 on ~/.ssh/config and ~/.ssh/known_hosts file plus more athmane said if you selinux is enforcing mode, just execute restorecon -Rv ~/.ssh from terminal.

Actions Speak Louder Than Words!

Powered by Jekyll and Hydejack v7.3.0