# [SOLVED] keychain: ssh_auth_sock in environment is invalid;

## wobbly

After some length of inactivity on my system I am having a problem that seems

to be related to keychain, openssl, and/or X windows. For example when I fire up

a new terminal I get

```

KeyChain 2.5.4.1; http://www.gentoo.org/proj/en/keychain/

Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL

 * Warning: SSH_AUTH_SOCK in environment is invalid; ignoring it

 * Found existing ssh-agent (8393)

 * Adding 1 ssh key(s)...

Could not open a connection to your authentication agent.

 * Error: Problem adding; giving up

ICF-> 

ICF-> echo $SSH_AUTH_SOCK

/tmp/ssh-MIpExQ8392/agent.8392

```

In some cases this is also related to breaking X windows since when I try to fire

up the new terminal it doesn't come up. There are more details regarding the X windows aspects here

https://forums.gentoo.org/viewtopic-t-320144-highlight-xscreensaver+breaks.html

I can kill ssh-agent, then fire up a new terminal

```

KeyChain 2.5.4.1; http://www.gentoo.org/proj/en/keychain/

Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL

 * Warning: SSH_AUTH_SOCK in environment is invalid; ignoring it

 * Initializing /home/wohlbier/.keychain/gyrotwystron-sh file...

 * Initializing /home/wohlbier/.keychain/gyrotwystron-csh file...

 * Starting ssh-agent

 * Adding 1 ssh key(s)...

Enter passphrase for /home/wohlbier/.ssh/id_dsa: 

Identity added: /home/wohlbier/.ssh/id_dsa (/home/wohlbier/.ssh/id_dsa)

```

But if X windows dies then I have to reboot the system. It is very annoying. Any

suggestions on how to debug this, and to determine whether the ssh-agent problem

is related to the X windows problem?

I'm not entirely sure the problems are entwined, but it sure seems so. The other

bit of informations is that I also have an IBM laptop for which this never happens.

The main difference is that I have an nvidia card in the box that breaks.

----------

## wobbly

Be careful with tmpreaper!!! I was having several problems that seemed to be related,

but I couldn't figure out why. They were related b/c I was trashing /tmp with tmpreaper.

Some time ago I thought this was the problem, removed /tmp from my tmpreaper 

in cron.daily, but the problems persisted. It turns out that emacs left the ~ version of the script

(with cleaning out /tmp) and anything in /etc/cron.daily gets executed. Ooops.

----------

