Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu 11.10 and using autosshfs, a per user SSHFS automount using user’s SSH config and keys. This works great except that Gnome Keyring isn't remembering the authentication and constantly prompts for the password to the key when remounting (after ssh timeout).

My RSA keys reside inside ~/.ssh with the very restrictive 0400 permissions. I've added the private keys to the keyring with ssh-add and the public keys to authenticated_keys. I can confirm that they are in the keyring since they show up when I run ssh-add -l.

Snip from auth.log looks like this:

Oct  5 14:01:34 flax sudo:     root : TTY=unknown ; PWD=/ ; USER=oddy ; COMMAND=/bin/bash -c \/usr\/local\/sbin\/autosshfs-ssh remotehost\.com;
Oct  5 14:13:45 flax sudo:     oddy : TTY=pts/0 ; PWD=/home/oddy ; USER=root ; COMMAND=/bin/cat /var/log/auth.log
Oct  5 14:14:51  sudo: last message repeated 2 times
Oct  5 14:17:01 flax CRON[5862]: pam_unix(cron:session): session opened for user root by (uid=0)
Oct  5 14:17:01 flax CRON[5862]: pam_unix(cron:session): session closed for user root
Oct  5 14:36:36 flax login[1309]: pam_unix(login:session): session opened for user oddy by LOGIN(uid=0)
Oct  5 14:38:11 flax login[1309]: pam_unix(login:session): session closed for user oddy

I can't find anything in there that would suggests that it's failing. SSH:ing to the remote host through console doesn't prompt for a password, so the keyring does work for that specific key, just not together with autosshfs.

Any ideas?

share|improve this question

1 Answer 1

Note that autosshfs uses keychain to set the environment variables s.t. ssh can find the ssh-agent and its authentication socket. If you haven't told keychain to manage the key you want to use for sshfs it will ask for your passphrase. Check the output of keychain -q --eval, which is what autosshfs will run.

A few more debugging hints from issues I previously fell over:

  • I'm assuming your .ssh/config specifies which key to use for the remote host?
  • Do you have keys in .ssh not added to the keychain ssh could possibly offer (and hence ask you to unlock)?
  • Did you use the same hostname when you tried logging in on the shell that you use with autosshfs (e.g. you use and alias for autosshfs and tried the full hostname in the shell)?
  • Have you verified that ssh-agent was still running and still had your keys loaded at the point autosshfs was failing / asking for the passphrase?
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.