gpg-agent

Juan Orti Alcaine juan.orti at miceliux.com
Fri Aug 23 07:19:11 UTC 2013


El 2013-08-22 20:18, Martin S escribió:
> As I understand it the file gpg-agent-startup.sh should be placed in
> /etc/kde/env and made executable for the gpg-agent to start att boot 
> time?
> Agent is also enabled in the ~/.gnupg/gpg.conf
> 
> Running the file manually it starts the agent, but after having booted, 
> the
> gpg-agent isn't started, so it seems the directory/file isn't read at 
> boot
> time?
> 
> Where should that file be place to be run at startup?
> 
> /Martin S


My setup with ssh-agent and gpg-agent:

$ cat ~/.kde/env/ssh-agent.sh
#!/bin/bash
# SSH Agent
if [ -f "${HOME}/.ssh/environment" ]; then
     . "${HOME}/.ssh/environment" > /dev/null
fi

$ cat ~/.kde/env/gpg-agent.sh
#!/bin/bash
# Set GPG Agent environment
if `tty -s`; then
    GPG_TTY="$(tty)"
    export GPG_TTY
else
    unset GPG_TTY
fi
if [ -n "$(pgrep -U $LOGNAME gpg-agent)" -a -f 
${HOME}/.gnupg/gpg-agent-info ]; then
    . ${HOME}/.gnupg/gpg-agent-info
    export GPG_AGENT_INFO
else
    unset GPG_AGENT_INFO
    if [ -f ${HOME}/.gnupg/gpg-agent-info ]; then
       rm -f ${HOME}/.gnupg/gpg-agent-info
    fi
fi

$ cat ~/.kde/Autostart/ssh-add.sh
#!/bin/sh
ssh-add </dev/null

$ crontab -l
# GPG Agent
@reboot         umask 0077; rm -f $HOME/.gnupg/gpg-agent-info; pgrep -U 
$LOGNAME gpg-agent >/dev/null 2>&1 || gpg-agent --daemon 
--write-env-file "${HOME}/.gnupg/gpg-agent-info" >/dev/null 2>&1

# SSH Agent
@reboot         umask 0077; rm -f $HOME/.ssh/environment; pgrep -U 
$LOGNAME ssh-agent >/dev/null 2>&1 || ssh-agent | sed 's/^echo/#echo/' > 
$HOME/.ssh/environment


More information about the users mailing list