Created
March 13, 2021 18:59
-
-
Save JTRNS/65d3b7e3a0ed23e05352d16cc59b7fbe to your computer and use it in GitHub Desktop.
ssh permissions fix
This file contains 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 | |
echo "fixing permissions for ssh" | |
# rwx --- --- | |
chmod 700 $HOME/.ssh | |
# if it is not a public key, -rw --- --- (inc. conf, auth_hosts) | |
find $HOME/.ssh -type f ! -name "*.pub" -print0 | xargs -0 chmod 600 | |
# -rw r-- r-- | |
find $HOME/.ssh -type f -name "*.pub" -print0 | xargs -0 chmod 644 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment