3

Say I am using only one encryption key most the time.

How do I set the default encryption key in order to avoid mentioning it in the encryption command

In other word, I want this command:

gpg -e

to be equivalent to the command with the recipient

gpg -e -r reciever@mail.edu

1 Answers1

5

GnuPG knows the --default-recipient option, which does exactly what you're looking for.

--default-recipient name
      Use name as default recipient if option --recipient is not used and don't
      ask if this is a valid one. name must be non-empty.

You can specify all GnuPG options in your GnuPG configuration file gpg.conf by omitting the -- prefix, for example

default-recipient reciever@mail.edu
Jens Erat
  • 18,485
  • 14
  • 68
  • 80