[arch-general] Starting gpg-agent on X login (gdm)

Shridhar Daithankar ghodechhap at ghodechhap.net
Sun Apr 26 23:12:26 EDT 2009


On Monday 27 April 2009 01:47:32 Magnus Therning wrote:
> After looking through my new shine Arch system I found that ssh-agent is
> run from /etc/gdm/Xsession, so I suppose that's where I need to make
> changes in order to get gpg-agent to run, right?

Hmm.. I use kde and there is nothing for ssh-agent in /etc.  I think it should 
go in shell startup so that even non-gui session have ssh-agent too.

I always ran it thr. ~/.xsession, from days of slackware so didn't notice it 
till now.

Here is the script I use. I also need to find out how to use gpg-agent as ssh-
agent. :)

-----------------------------------
if [ -x "$(which gpg-agent)" ]; then
  if test -f $HOME/.gpg-agent-info &&    kill -0 $(cut -d: -f 2 $HOME/.gpg-
agent-info) 2>/dev/null; then
    GPG_AGENT_INFO=$(cat $HOME/.gpg-agent-info)
    export GPG_AGENT_INFO
  else
    eval $(gpg-agent --daemon)
    echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info
  fi
fi

# Note that the new option --write-env-file may be used instead.

# You should always add the following lines to your .bashrc or whatever
# initialization file is used for all shell invocations:

GPG_TTY=$(tty)
export GPG_TTY


#Start ssh-agent. Don't want to use agent from last session if it persits at 
all.
killall ssh-agent;
eval `ssh-agent -s`;
export SSH_AGENT_PID;
export SSH_AUTH_SOCK;
-----------------------------------		

> Should I look into using seahorse instead of {ssh,gpg}-agent?

and I got to find a KDE equivalent too. :)

-- 
 Shridhar


More information about the arch-general mailing list