Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make auto trust gpg public key?

I am trying to add my GPG public key as a part of our appliance installation process. The purpose of it to encrypt any important files like logs before admin pulling them into his local using admin portal and then decrypt them using private key. The plan is to export public key into a file and make appliance installation process to import it using gpg --import command. But I realized, the key is needed to be trusted/signed before do any encryption. How to make this key is trusted without any human intervention at the time of installation? Btw, our appliance os is ubuntu vm and we use kickstart to automate.

Advance thanks for all help.

like image 434
user1366786 Avatar asked Oct 29 '12 05:10

user1366786


People also ask

What is GPG trust?

A key's trust level is something that you alone assign to the key, and it is considered private information. It is not packaged with the key when it is exported; it is even stored separately from your keyrings in a separate database. The GnuPG key editor may be used to adjust your trust in a key's owner.

What is GnuPG public key?

GnuPG uses public-key cryptography so that users may communicate securely. In a public-key system, each user has a pair of keys consisting of a private key and a public key. A user's private key is kept secret; it need never be revealed. The public key may be given to anyone with whom the user wants to communicate.


1 Answers

Your question is really "How do I encrypt to a key without gpg balking at the fact that the key is untrusted?"

One answer is you could sign the key.

gpg --edit-key YOUR_RECIPIENT sign yes save 

The other is you could tell gpg to go ahead and trust.

gpg --encrypt --recipient YOUR_RECIPIENT --trust-model always YOUR_FILE 
like image 127
Ray Avatar answered Oct 24 '22 21:10

Ray