### Please describe the problem.

When I login to my session, git-annex starts a few daemons, which is fine, but then it prompts me for tons of passwords, which is really annoying.

It is strange because one of the things I do when I start my session is to input my keys in the SSH agent. But then git-annex still prompts me:

~~~~
21503 ?        Sl     3:04 git-annex assistant --startdelay=5s
21517 ?        S      0:03  \_ git --git-dir=/srv/musique/anarcat/books/.git --work-tree=/srv/musique/anarcat/books cat-file --batch
21612 ?        SNl    0:00  \_ git-annex remotedaemon
21706 ?        S      0:00  \_ git --git-dir=/srv/musique/anarcat/books/.git --work-tree=/srv/musique/anarcat/books check-ignore -z --stdin --verbose --non-matching
21898 ?        SN     0:00  \_ git --git-dir=/srv/musique/anarcat/books/.git --work-tree=/srv/musique/anarcat/books check-attr -z --stdin annex.backend annex.numcopies --
 6712 ?        SNl    0:00  \_ git-annex transferkeys
 6719 ?        SN     0:00      \_ git --git-dir=/srv/musique/anarcat/books/.git --work-tree=/srv/musique/anarcat/books cat-file --batch
 6720 ?        SN     0:00      \_ rsync --progress --inplace --perms -e 'ssh' '-S' '.git/annex/ssh/anarc.at' '-o' 'ControlMaster=auto' '-o' 'ControlPersist=yes' '-T' 'anarc.at' 'git-annex-shell ''sendkey'' ''/srv/books'' ''SHA256E-s17781587--f204e6ef1f14b624e222d6ad73ed41edf65c29c93afad9a1e4e1954ad68d1753.pdf'' --uuid a75cbbf7-e055-423e-b375-443e0552c9e2 ''--'' ''remoteuuid=aa500f29-42d9-4777-ae02-4a2c3d47db44'' ''direct='' ''associatedfile=Garde cotiere canadienne/Navigation dans les glaces en eaux Canadiennes (1112)/Navigation dans les glaces en eaux Canadie - Garde cotiere canadienne.pdf'' ''--''' -- dummy: /srv/musique/anarcat/books/.git/annex/tmp/SHA256E-s17781587--f204e6ef1f14b624e222d6ad73ed41edf65c29c93afad9a1e4e1954ad68d1753.pdf
 6721 ?        SN     0:00          \_ ssh -S .git/annex/ssh/anarc.at -o ControlMaster=auto -o ControlPersist=yes -T anarc.at git-annex-shell 'sendkey' '/srv/books' 'SHA256E-s17781587--f204e6ef1f14b624e222d6ad73ed41edf65c29c93afad9a1e4e1954ad68d1753.pdf' --uuid a75cbbf7-e055-423e-b375-443e0552c9e2 '--' 'remoteuuid=aa500f29-42d9-4777-ae02-4a2c3d47db44' 'direct=' 'associatedfile=Garde cotiere canadienne/Navigation dans les glaces en eaux Canadiennes (1112)/Navigation dans les glaces en eaux Canadie - Garde cotiere canadienne.pdf' '--' dummy rsync --server --sender -vpe.Lsf --inplace .
 6722 ?        SN     0:00              \_ /usr/bin/ssh-askpass anarcat@anarc.at's password:
~~~~

Yet I can login to `shell.anarc.at` without a passphrase without problems.

Interestingly enough, my main session and git-annex do not seem to share the same `SSH_AGENT` environment variable. It's unclear to me why. git-annex's SSH_AGENT environment variable seems to refer to a process that disappeared, actually. So it could be there's something wrong with my session.

Still, when a situation like this occurs, it seems to me that it should generate in this noisy concert of ssh prompts that basically blocks all work until i hit "escape" often enough. In fact, that it is rather problematic to have random password prompts show up like this without an explanation: git-annex should tell me it's the source of this password prompt or not prompt at all, because there's no way i'll start entering random passphrases into random pinentry dialogs that show up... 

Doesn't git-annex deploy its own ssh keys once it has established a connexion with an SSH remote?

> After more investigation, it turns out this peculiar git-annex daemon was some left-overs from a previous session i had logged out of. It is unclear why git-annex was still running, but there were also pulseaudio and redshift programs lying around so I suspect it wasn't git-annex specific.
>
> However, this problem remains on login. When I start a new session, there's a race condition between git-annex asking passwords and ssh-add asking me to unlock my private key. It's a nice festival of password prompts as I struggle to type in my ssh key faster than git-annex asks me for the remote host's password.
> 
> In general, I think git-annex should set `PasswordAuthentication=no` (or allow me to configure it as such), especially if it knows it was able to login without a password at some point. It should especially do that if there's no UI attached informing the user it will be prompting for a password. `NumberOfPasswordPrompts=1` would also be a welcome improvement, but I really don't think I should be seeing those password prompts, especially since I *can* login to the server with my existing SSH key.
>
> Also note that I use Monkeysphere to input my private key into the SSH agent so it could explain why this doesn't usually happen to other people: Monkeysphere doesn't automatically get started from `ssh` if the key is missing, and instead `ssh` will revert to a regular password-based authentication which competes with the Monkeysphere password prompt.

### What steps will reproduce the problem?

It's unclear - i guess you need to setup git-annex to autostart and sync with remote ssh annexes. You may also need to have to use XFCE with Awesome to reproduce the problem. I can provide more details on my session setup on request. --[[anarcat]]

### What version of git-annex are you using? On what operating system?

5.20140927~bpo70+3 on debian wheezy.

> The git-annex daemon being a "leftover" from a previous session seems
> like the root cause. We have a new bug for this,
> [[bugs/kill_git-annex_assistant_on_logout]], so I am going to close this
> one as a dup. [[done]] --[[Joey]]
