From fba184d4f84be2debce068a52555e82aa021b4a6 Mon Sep 17 00:00:00 2001 From: askiiart Date: Fri, 1 Sep 2023 06:58:35 -0500 Subject: [PATCH] *Actually* fix gnupg perms --- daily-use-pcs/setup-git.bash | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/daily-use-pcs/setup-git.bash b/daily-use-pcs/setup-git.bash index 22e19a2..d4e5804 100755 --- a/daily-use-pcs/setup-git.bash +++ b/daily-use-pcs/setup-git.bash @@ -93,9 +93,15 @@ else echo Gitea URL: ${GITEA_URL}/user/settings/keys echo GitHub URL: https://github.com/settings/ssh/new fi -echo Fixing permissions -sudo chown -R $(whoami) /home/$(whoami)/.gnupg -sudo chgrp -R $(whoami) /home/$(whoami)/.gnupg -sudo chmod -R 600 /home/$(whoami)/.gnupg + +# From https://superuser.com/a/954639 +# Archived at https://web.archive.org/web/20230606153856/https://superuser.com/a/954639 +echo Fixing .gnupg/ permissions +# Set ownership to your own user and primary group +chown -R "$USER:$(id -gn)" ~/.gnupg +# Set permissions to read, write, execute for only yourself, no others +chmod 700 ~/.gnupg +# Set permissions to read, write for only yourself, no others +chmod 600 ~/.gnupg/* read -p "Done. Now verify your SSH and GPG keys in Git*"