Permission denied while deleting secret key by `gpg --delete-secret-keys name`

Solution Verified - Updated -

Issue

  • Switch userA from userB by the su command, userA is not able to delete secret keys due to "Permission denied".
[userA@efi8 ~]$ gpg --delete-secret-keys FAAC601700B5612F67D176DB776D6D1BCDFB7379
gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


sec  rsa2048/776D6D1BCDFB7379 2023-05-26 redhat

Delete this key from the keyring? (y/N) y
This is a secret key! - really delete? (y/N) y
gpg: deleting secret key failed: Permission denied
gpg: deleting secret subkey failed: Permission denied
gpg: FAAC601700B5612F67D176DB776D6D1BCDFB7379: delete key failed: Permission denied
  • Login as userA directly, UserA can delete secret keys.

Environment

  • Red Hat Enterprise Linux 8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content