Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
This should be a quick/easy one. I encrypted a couple of files and decrypted them immediately after to see if the system worked. It functioned flawlessly.
I then encrypted a few important files, destroyed the originals and forgot about them. Today, I needed one of the files as a reference and I was unable to decrypt it. This is the error msg:
"gpg: WARNING: unsafe permissions on homedir `/home/mathay/'
[GNUPG:] ENC_TO 43E8EA1B7F313FDD 16 0
gpg: encrypted with ELG-E key, ID 7F313FDD
[GNUPG:] NO_SECKEY 43E8EA1B7F313FDD
[GNUPG:] BEGIN_DECRYPTION
[GNUPG:] DECRYPTION_FAILED
gpg: decryption failed: secret key not available
[GNUPG:] END_DECRYPTION"
Last edited by drmjh; 05-12-2007 at 02:31 PM.
Reason: .png file not was not uploaded; txt was substituted
Do you have your secret key? Try looking at the output of “gpg -K” to see if one matches the ID of the key with which your file was encrypted. If not, find it (perhaps you moved homedirs or misplaced “$HOME/.gnupg/secring.gpg”).
mathay@linux:~> gpg -k
/home/mathay/.gnupg/pubring.gpg
-------------------------------
pub 1024D/307E20F4 2007-01-23
uid matthew hayes <24mm@eircom.net>
sub 1024g/7F313FDD 2007-01-23
This is your public keyring (which seems rather empty). I said “-K” not “-k”. Execute:
Code:
$ gpg -K
to list your secret keys. (Note, it will not list them in a way that violates your privacy if you post it here. You don’t have to post it if you don’t want to — just look for the matching ID.)
I think I may have the reason my decryption failed.
I noticed a (Key file-change)date discrepancy between the original file I encrypted and the last files I encrypted. Although I only ever created one key, several months after the creation, I signed the key.
The original file was encrypted with the unsigned key and I'm trying to decrypt it with a signed key
Thanks for your help, using the gpg -K, gave me the clue. (assuming I'm correct)
drmjh
Signing a key should have no effect on its ability to encrypt or decrypt. You may want to fix the permissions on your home directory and your .gpg sub-directory. GPG may be ignoring the keys there on encrypt/decrypt operations until they are fixed.
Thanks for your response, Matir.
I chown /home to myself. Since this is a single user system, I didn't think it was that dangerous to do that and it was quicker than figuring out setuid.
That sorted the permission problem for home and sub dirs.
But, I still get the same Err Msg. I located the .gpg dir, it's in root ~
I somehow don't think it would be prudent to change permissions here. Besides, I'm beginning to think that Err Msg. about permissions is a very frequent and perhaps spurious/non specific Err. Msg. The man pages even has a command to suppress this Msg. I think I'll just delete the key and start over. I won't be able to open the one file that I'm interested in but it might prove to be an easier solution.
Thanks for your help.
drmjh.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.