Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 26390  / 1 Year ago, sat, april 8, 2023, 5:26:26
gpg: WARNING: unsafe permissions on configuration file `/home/david/.gnupg/gpg.conf'
gpg: WARNING: unsafe enclosing directory permissions on configuration file `/home/david/.gnupg/gpg.conf'
gpg: external program calls are disabled due to unsafe options file permissions
gpg: keyserver communications error: general error
gpg: keyserver receive failed: general error


What does it mean and how to fix?


More From » gnupg

 Answers
2

gpg: WARNING: unsafe permissions on configuration file /home/david/.gnupg/gpg.conf'
gpg: WARNING: unsafe enclosing directory permissions on configuration file
/home/david/.gnupg/gpg.conf'
gpg: external program calls are disabled due to unsafe options file permissions




This means that your ~/.gnupg/gpg.conf has unexpected permissions for the user you are running as, like write access to "others", another user or the executable bit. This file should always for security reasons only be readable and writable by the user, and no one else:



$ ls -l ~/.gnupg/gpg.conf
-rw------- 1 braiam braiam 7890 Jul 8 18:51 .gnupg/gpg.conf


Yours probably has different user or permissions. Check them out using ls -l ~/.gnupg/gpg.conf. To fix this is simple enough:



chown $(whoami):$(whoami) ~/.gnupg/gpg.conf ## if this fails read at the bottom
chmod 600 ~/.gnupg/gpg.conf


If some of the commands fails, or you keep getting the error message you mentioned after following these instructions, you should delete the ~/.gnupg directory, because it cannot be trusted anymore.



rm -r ~/.gnupg/gpg.conf ## If this fails, use sudo


You can then try to run gpg command with the same user that is going to run the script, this way your user with create ~/.gnupg directory with appropriate permissions.


[#30004] Sunday, April 9, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
repend

Total Points: 195
Total Questions: 113
Total Answers: 107

Location: Nicaragua
Member since Tue, Dec 8, 2020
3 Years ago
repend questions
Thu, May 11, 23, 09:38, 1 Year ago
Thu, Jan 5, 23, 21:41, 1 Year ago
Mon, Nov 22, 21, 19:37, 3 Years ago
Mon, Jan 24, 22, 11:26, 2 Years ago
;