Reply to topic

invoking the GPC-AGENT and to initially firing up the agent

Registered Member
hello dear kde-friends,

i currently stuck to the process "invoking the GPC-AGENT" , as a prerequisite for Thunderbird and enigmail .

i am trying to initially firing up the agent to run enigmail
i am currently configuring all the prerequesites for the thunderbird and enigmail

at the moment i have a vanilla-installation of opensuse 12.3 on my notebook - all is fresh - no old data or credentials are used.
The whole systme is new and fresh.

see the following data - of the operating system and the rest of fresh installation
note - i do not need to import all the mails - i only need to import the credentials. and i have managed this.

so to sume up what is gained: what is on the machine; - the following things:

operating-system; OpenSuse 12.3
Thunderbird Version 17.0.5
gpg2 - GnuPG 2
GnuPG 2 is the successor of "GnuPG" or GPG. It provides: GPGSM, gpg-agent, and a keybox library.
version 2.0.19-5.1.1. i 586 OpenSuse 12.3-1.7 mit Prioritäg 99
libassuan0 - IPC library used by GnuPG version 2
version 2.0.3-2.1.1 i586 OpenSuse 12.3-1.7 mit Prioritäg 99
libgpgme11 - a library that allows the access of programmes to GnuPG.

again: well and i ve done a import of the credentials and password files into the KGpg
in KGpg all the passwords are included.

By the way - i do not want to use openPGP. i prefer the usage of KGpg

The question now is: how to proceed the next steps are to look for the correct installation and configuring of gnupg.

Code: Select all
martin@linux-70ce:~/perl>      gpg --version
gpg (GnuPG) 2.0.19
libgcrypt 1.5.0
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Unterstützte Verfahren:
Öff. Schlüssel: RSA, ELG, DSA
            CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Komprimierung: nicht komprimiert, ZIP, ZLIB, BZIP2
martin@linux-70ce:~/perl> ^C

On this page here - Invoking GPG-AGENT - Using the GNU Privacy Guard
a short descripton on Invoking GPG-AGENT shows how to do things.

question: how to invoke the gnupg? and very very important for me is the question -
Do i have to invoke this GPC-AGENT for one or how many user!?

It is best not to run multiple instance of the gpg-agent, so you should make sure that only one is running.

How to make sure that i do invoke the GPC-AGENT only one time and not twice or three times.

Which steps are needet - what do i need to get enigmail up and running!?

love to hear from you


2 Invoking GPG-AGENT

gpg-agent is a daemon to manage secret (private) keys independently from any protocol.
It is used as a backend for gpg and gpgsm as well as for a couple of other utilities.
The usual way to run the agent is from the ~/.xsession file:

Code: Select all
     eval $(gpg-agent --daemon)

If you don't use an X server, you can also put this into your regular startup file ~/.pro file or .bash_profile.
It is best not to run multiple instance of the gpg-agent, so you should make sure that only one is running:
gpg-agent uses an environment variable to inform clients about the communication parameters. You can write
the content of this environment variable to a file so that you can test for a running agent.
Here is an example using Bourne shell syntax:

Code: Select all
     gpg-agent --daemon --enable-ssh-support \
               --write-env-file "${HOME}/.gpg-agent-info"

This code should only be run once per user session to initially fire up the agent.
In the example the optional support for the included Secure Shell agent is enabled and the information about the agent is written to a file in the HOME directory. Note that by running gpg-agent without arguments you may test whether an agent is already running;
however such a test may lead to a race condition, thus it is not suggested.

The second script needs to be run for each interactive session:

Code: Select all
     if [ -f "${HOME}/.gpg-agent-info" ]; then
       . "${HOME}/.gpg-agent-info"
       export GPG_AGENT_INFO
       export SSH_AUTH_SOCK

see also:
Invoking GPG-AGENT - Using the GNU Privacy Guard

love to hear from you

User avatar bcooksley
If you are using KDE, then setting up a gpg-agent which lasts the entire life time of your session is simple enough.
Simply use a text editor to save the below content into a executable *.sh file, which needs to be placed in ~/.kde4/env/
Code: Select all
AGENTPID=$(pidof gpg-agent)
if [ "$AGENTPID" = "" ]; then
    gpg-agent --daemon --enable-ssh-support --write-env-file "${HOME}/.gpg-agent-info" --default-cache-ttl-ssh 86400 --max-cache-ttl-ssh 604800 &> /dev/null

if [ -f "${HOME}/.gpg-agent-info" ]; then
    source "${HOME}/.gpg-agent-info"
    export GPG_AGENT_INFO
    export SSH_AUTH_SOCK
    export SSH_AGENT_PID

On my system, I have the file at "~/.kde4/env/"
It is absolutely crucial that the file is executable as well.

Once it is in place, logout and back in again, and everything should "just work" - in theory at least.

System Settings and Device Actions KCM maintainer

Reply to topic


Who is online

Registered users: Alexa [Bot], anli, Baidu [Spider], Bing [Bot], binro, Exabot [Bot], Ganitzsh, garthecho, Google [Bot], google01103, ken300, koriun, lazyit, Majestic-12 [Bot], Nerdfest, netpalantir, SeaJey, SecretCode, sfepa, vascobasque, W3C [Validator], Yahoo [Bot]