> For the complete documentation index, see [llms.txt](https://til.yulrizka.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.yulrizka.com/unix/fix-gpg-warning-unsafe-permissions-on-homedir.md).

# 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'
```

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

```
chown -R $(whoami) ~/.gnupg/
```

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
```
