Skip to content

Instantly share code, notes, and snippets.

@memoryleak
Created May 26, 2021 09:13
Show Gist options
  • Save memoryleak/a40c23234abf61b8d5d424e6f119a4f9 to your computer and use it in GitHub Desktop.
Save memoryleak/a40c23234abf61b8d5d424e6f119a4f9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
sudo chown -R $USER:$USER $HOME/.ssh
# Base line permission
sudo chmod -R 0600 $HOME/.ssh
# Not sensible
sudo chmod -R 0600 $HOME/.ssh/config
sudo chmod -R 0600 $HOME/.ssh/authorized_keys
# Not sensible, needs to be readable by all
sudo chmod -R 0644 $HOME/.ssh/*.pub
sudo chmod -R 0644 $HOME/.ssh/known_hosts
# SSH folder must be executeable
sudo chmod 0700 $HOME/.ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment