Skip to content

Instantly share code, notes, and snippets.

@zkelo
Forked from grenade/01-generate-ed25519-ssh-key.sh
Last active March 17, 2022 12:23
Show Gist options
  • Save zkelo/41c674c693e940a87729dbe03f7822b6 to your computer and use it in GitHub Desktop.
Save zkelo/41c674c693e940a87729dbe03f7822b6 to your computer and use it in GitHub Desktop.
Correct file permissions for ssh keys and config.
#!/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