DEV Community

Ahmy Yulrizka
Ahmy Yulrizka

Posted on • Originally published at til.yulrizka.com

Fix gpg: WARNING: unsafe permissions on homedir

When you copy gpg configuration form other machine, you might get warning as follow

gpg: WARNING: unsafe permissions on homedir '/home/user/.gnupg'
Enter fullscreen mode Exit fullscreen mode

To fix this, make sure that The .gnupg directory has the correct permission.

chown -R $(whoami) ~/.gnupg/
Enter fullscreen mode Exit fullscreen mode

And files & folder inside has the correct permisson

find ~/.gnupg -type f -exec chmod 600 {} \; # Set 600 for files
find ~/.gnupg -type d -exec chmod 700 {} \; # Set 700 for directories
Enter fullscreen mode Exit fullscreen mode

Top comments (0)