Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sshfs not mounting when using GPG auth key on YubiKey #287

Open
duncan-bayne opened this issue Dec 3, 2023 · 2 comments
Open

sshfs not mounting when using GPG auth key on YubiKey #287

duncan-bayne opened this issue Dec 3, 2023 · 2 comments

Comments

@duncan-bayne
Copy link

Firstly, thanks for sshfs :)

If I ssh into my server, it works:

$ ssh dev.home
___________________________
< You have no real enemies. >
 ---------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
~ $

If I try mounting my home directory via sshfs, it fails:

 $ sudo sshfs -v -o allow_other,default_permissions [email protected]:/home/duncan ~/dev/
[email protected]: Permission denied (publickey).

Pretty sure this has something to do with the fact that my SSH auth is happening via my GPG auth key, which lives on my YubiKey 5 Nano.

Versions of things:

  • SSHFS version 3.7.1
  • FUSE library version 3.10.5
  • using FUSE kernel interface version 7.31
  • fusermount3 version: 3.10.5
  • YubiKey 5 Nano
  • gpg (GnuPG) 2.2.27
  • libgcrypt 1.9.4

I appreciate that I'll need to raise a PR to fix this myself, but wanted to raise the issue first.

@h4sh5
Copy link
Collaborator

h4sh5 commented Dec 27, 2023

What have you got in your ~/.ssh/config file?

Sometimes if you don't specifically define the SSH key via identityfile /path/to/key, it will try to authenticate using all keys on your system and then SSH will fail on too many attempts before it reaches your correct key (see https://superuser.com/questions/268776/how-do-i-configure-ssh-so-it-doesnt-try-all-the-identity-files-automatically)

Or, since you're using yubikeys you might have a agent socket setup that isn't defined in ssh config?

@duncan-bayne
Copy link
Author

Currently I have:

SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh

... set in my environment variables. Should that do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants