# running "ssh-add -D" as root failed nowadays

## toralf

I'm convinced that this worked in the past, but nowadays I do get :

```
t44 ~ # su - tfoerste -c "export DISPLAY=:0; ssh-add -D"

Could not open a connection to your authentication agent.

```

Any hints ?

----------

## SpaceToast

"Could not open a connection to your authentication agent. "

This suggests that either ssh-agent is not running, or that your user cannot communicate with it.

However, I'm not sure what you're trying to achieve here ("that this worked in the past"). Here is what this will do:

1. Become user tfoerste and change into that user's login environment.

2. In that environment, tell all future X applications to use desktop :0 (default 1st).

3. Delete all identities from ssh-agent (note that this is not an X application).

So while your problem (the error you are getting) can be fairly easily solved by ensuring that ssh-agent is running: 

```
eval $(ssh-agent -s)
```

, it would be useful to know specifically what you are trying to achieve, so that we can help you figure out a more efficient way to achieve it  :Smile: 

----------

