Skip to content

Instantly share code, notes, and snippets.

@ChristopherA
Last active March 14, 2021 12:59
Show Gist options
  • Save ChristopherA/86fa0016c7363fc9b305a93bf57ced86 to your computer and use it in GitHub Desktop.
Save ChristopherA/86fa0016c7363fc9b305a93bf57ced86 to your computer and use it in GitHub Desktop.
SCP SSH & GPG and Set Folder Permissions
#on local machine
scp -Cvpr .private/ christophera@domain.local:.ssh/
scp -Cvpr .private/ christophera@domain.local:.gnupg/
scp -Cvpr .private/ christophera@domain.local:.profile.local
ssh christophera@domain.local
#on remote machine
sudo -v
sudo chown -R christophera ~christophera/.gnupg/
sudo chown -R christophera ~christophera/.gnupg/*
sudo chown -R christophera ~christophera/.ssh/*
sudo chown -R christophera ~christophera/.ssh/*
chmod 755 ~
chmod 600 ~/.ssh/*
chmod 600 ~/.ssh/id_*
chmod 644 ~/.ssh/*.pub
chmod 644 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
bash ~/.profile.local
gpgconf --kill gpg-agent
export GPG_TTY=$(tty)
echo "test" | gpg --clearsign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment