How do I set a GPG key as trusted?

{mosimage}

If you’ve added someones GPG public key that you want to use for encrypting files non-interactively (i.e. in a script), you may find you get the following error until the key is signed and trusted: –

“There is no assurance this key belongs to the named user”

If so, read on…


Firstly you need to sign the key with

gpg –sign-key “name”

Where name is the name of the public key you are signing.

For good measure run

gpg –update-trustdb

Now we need to change the trust for the key….

gpg –edit-key “name”

gpg (GnuPG) 1.4.7; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

<key details here including the current trust level>

Command> trust

<key details here including the current trust level>

Please decide how far you trust this user to correctly verify other users’ keys
(by looking at passports, checking fingerprints from different sources, etc.)

  1 = I don’t know or won’t say
  2 = I do NOT trust
  3 = I trust marginally
  4 = I trust fully
  5 = I trust ultimately
  m = back to the main menu

Your decision?

Choose 5, then “quit”.

Now encrypting files will not produce the warning seen above.

About

I'm a freelance UNIX engineer working in the UK. I'm married to Tina and between us we have six children. I'm a bit of an Apple fan boy, and all the Windows machines in the house are a thing of the past now.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Private
%d bloggers like this: