1

The former xxx.BrokerImport is expired, and I generate a new key with the same name 'xxx.Import' and import it into remote server. But I can't delete the former one. They have same name, when I use 'xxx.Import' to encrypt, it will failed, I guess it used the former one not the new import one.

I want to delete one expired key in remote server.

Use root user to execute commands:

[root@ip-xxx xxx_ansible]#gpg --delete-key B7C1CB35

But get following error:

gpg: WARNING: unsafe ownership on homedir `/XXX/XXX_Import_tools/Keys'

I used root user to execute this, no idea why I haven't permission.

And I try:

[root@ip-xxx xxx_ansible]# sudo gpg --delete-key B7C1CB35

then get another error:

 gpg: key "B7C1CB35" not found: Unknown system error
 gpg: B7C1CB35: delete key failed: Unknown system error

However the public key is exist.

 [root@ip-xxx xxx_ansible]# gpg --list-keys
 gpg: WARNING: unsafe ownership on homedir `/xxx/xxx_Import_tools/Keys'
 /xxx/xxx_Import_tools/Keys/pubring.gpg
 ------------------------------------------------
 pub   2048R/B7C1CB35 2016-05-12 [expired: 2018-04-24]
 uid                  xxx.Import <xxx@xxx.com>

 pub   2048R/B75F015E 2018-07-23
 uid                  xxx.Import <xxx@xxx.com>
 sub   2048R/65AED995 2018-07-23

Does anyone has idea about this? Hope to get your help.

Destiny
  • 21
  • 2

1 Answers1

0

Since I have resolve this issue, I'd like to share my solution.

I want to delete the key with command directly, but due to permission deny, I delete the pubring.gpg / secring.gpg / trustdb.gpg in remote server. And After next deployment, these key will be import by ansible script. And these file will be generated.

Destiny
  • 21
  • 2