Skip to content

Instantly share code, notes, and snippets.

@folliehiyuki
Created November 30, 2020 17:06
Show Gist options
  • Save folliehiyuki/6a21d319f580f8a344b05eb015e5dd30 to your computer and use it in GitHub Desktop.
Save folliehiyuki/6a21d319f580f8a344b05eb015e5dd30 to your computer and use it in GitHub Desktop.
Correct gnupg permission
#!/bin/bash
# This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) "${GNUPGHOME:-$HOME/.gnupg}/"
# Also correct the permissions and access rights on the directory
chmod 600 "${GNUPGHOME:-$HOME/.gnupg}/*"
chmod 700 "${GNUPGHOME:-$HOME/.gnupg}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment