Forked from grenade/01-generate-ed25519-ssh-key.sh
Last active
March 17, 2022 12:23
-
-
Save zkelo/41c674c693e940a87729dbe03f7822b6 to your computer and use it in GitHub Desktop.
Correct file permissions for ssh keys and config.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Менять порядок строк не рекомендуется! | |
ssh_dir=~/.ssh | |
find $ssh_dir -name "*_*" -exec chmod 600 {} \; | |
find $ssh_dir -name "*_*.pub" -exec chmod 644 {} \; | |
chmod 644 $ssh_dir/authorized_keys $ssh_dir/known_hosts $ssh_dir/config | |
chmod 700 $ssh_dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment