How-to properly set gpg-agent in Slackware-14.1?
I am using Fluxbox on Slackware-14.1n, started through gdm, and would like to avoid typing my passphrase too often. I use gnupg2.
I tried to configure gpg-agent but didn't succeed so far. I didn't find anything on SlackDocs. I have written:
|
I just used what's basically told in "man gpg-agent".
I have this in my ~/.profile : Code:
# GPG helper functions: |
This works. Your solution have the advantage of keeping all the settings in the same file, valid on the console as under X.
So, thanks Eric! |
gnupg2 always uses the agent (so the use-agent directive is not needed) and starts it automatically. You only need to manually start it if you also use it for ssh authentication because ssh doesn't know about it.
The most known way to start it is what Eric mentioned but there is a "newer" one too (it was mentioned in the mailing list some time ago but it was put in the manpage of gpg-agent too). Code:
cat .gnupg/gpg-agent.conf .zshrc or .bashrc or equivalent interactive shell startup file Code:
unset GPG_AGENT_INFO Code:
GPG_TTY=$(tty) Code:
if [ -x "$(which gpg-connect-agent)" ]; then If you do not use ssh emulation then only put "use-standard-socket" and everything will work. Edit: This way works only with gnugp2 and not with gnupg. |
Interesting... here's mine, in $HOME/.xprofile since I use a gui login manager:
Code:
if test -f $HOME/.cache/gpg-agent-info && ps $(cut -d: -f 2 $HOME/.cache/gpg-agent-info) 1>/dev/null 2>/dev/null ; then Code:
use-standard-socket That --use-standard-socket option seems to just make it use $HOME/somewhere instead of /tmp - I like it. On a related note, I seem to have some sort of race condition between ssh-agent (shipped with openssh) and gpg's agent -- sometimes gpg wins and sometimes ssh-agent wins. I can't figure out what's starting ssh-agent :/ EDIT: quite possibly that was a bug in my code before after making the edits for using standard socket - can't repro now, it seems. |
Sorry to necrobump this thread : long ago I started using Alien Bob's advice to have this set up.
It's been quite long time since I've got an error at my shell launch (that do not seem critical to me, but not sure...) Code:
use-standard-socket Code:
gpg-agent is already running - won't launch another instance Doesn't seem too critical either but the code generating this is much harder for me to understand and I haven't found any newer posts. Any help would be much apreciated Regards |
Which version of GnuPG are you using? Since your profile indicates “Slackware-current”, I assume it’s GnuPG 2.2.x (instead of GnuPG 2.0.x as in Slackware 14.2 or less).
With GnuPG 2.2, if you do not plan to use GPG-Agent for SSH then you don’t need anything in your profile scripts beyond the export GPG_TTY=$(tty) line. All GnuPG components will start the agent on-demand if one is not already running. They know where to look for the agent’s socket and the GPG_AGENT_INFO environment variable is not used anymore. If you do want SSH support, then you need to: ① make sure the agent is running before attempting any SSH connection, and ② set the SSH_AUTH_SOCK environment variable to the agent’s socket. To achieve ①, is is enough to call gpg-connect-agent /bye. Alternatively you may use gpgconf --launch gpg-agent, the end result will be the same. For ②, the recommended way to get the path to the socket is gpgconf --list-dirs agent-ssh-socket. |
How-to properly set gpg-agent in Slackware-14.1?
Thanks. I'll try to get this working the right way.
|
All times are GMT -5. The time now is 04:01 AM. |