Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

suppress warning messages in gnupg

Tags:

bash

gnupg

I was using gpg to just for encryption and decryption purpose.

the commands I used are:

for enc:
gpg --sign test
for dec:
gpg --decrypt test.gpg > test

but I am getting below warning messages :

gpg: Signature made Fri Jun 24 17:29:00 2016 UTC using RSA key ID XXXX
gpg: Good signature from "[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.

off course I have tried with --status-fd, --no-comment, --no-mdc-warning,--no-tty ,--no-verbose --quiet --batch, --no-greeting etc based on Internet search.

Is there a way to get rid off these warning messages ?

As a last option, I am using How to hide command output in bash

But I think there should be an easy method to suppress warning in gpg.

like image 591
AKV Avatar asked Sep 13 '25 16:09

AKV


1 Answers

The warning is being shown on STDERR, you can redirect the STDERR stream to /dev/null to get rid of the warning:

gpg --decrypt test.gpg 2>/dev/null

Saving the STDOUT too:

gpg --decrypt test.gpg 2>/dev/null >test
like image 165
heemayl Avatar answered Sep 16 '25 07:09

heemayl