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

Add smartcard support #177

Open
djwhitt opened this issue Feb 4, 2018 · 10 comments
Open

Add smartcard support #177

djwhitt opened this issue Feb 4, 2018 · 10 comments

Comments

@djwhitt
Copy link

djwhitt commented Feb 4, 2018

The Chromebook SSH app supports smartcards (e.g. Yubikeys). Adding similar to support for mosh would be great both in terms of security and convenience.

@rpwoodbu
Copy link
Owner

rpwoodbu commented Feb 4, 2018

This support already exists, but I haven't actually documented it. It works similarly to how it does in Secure Shell, except that the agent app ID is hardcoded, so there is no configuration; if the app is installed, and if there's a Yubikey (or similar) with SSH keys on it, it'll try to use it.

Let me know whether you're able to get it to work. I'll go ahead and close this for now.

@rpwoodbu rpwoodbu closed this as completed Feb 4, 2018
@djwhitt
Copy link
Author

djwhitt commented Feb 4, 2018 via email

@rpwoodbu
Copy link
Owner

rpwoodbu commented Feb 4, 2018

Not sure what the "SSH forward helper" is. I haven't seen anything like that.

You can experiment with other apps either by editing the code and rebuilding, or poking your way through the JS console and reassigning that app ID variable. Note, however, that those apps may have a whitelist of other apps that are permitted access, and Mosh for Chrome may not be on that list. (gnubbyd has such a thing, and I got us whitelisted.)

@rpwoodbu rpwoodbu reopened this Feb 4, 2018
@rpwoodbu
Copy link
Owner

rpwoodbu commented Feb 4, 2018

Oh, actually, I might have an idea about the "SSH forward helper" thing. I know about "native messaging", which is a facility through which Chrome can communicate with a native binary on your local machine. This binary has to be installed and configured administratively (i.e., cannot be done by installing a Chrome app or extension alone). I suspect that gnubbyd may have a way to talk to your local ssh-agent if you configure that (just a guess).

I still don't know why you'd be getting that error message, though. I don't immediately see an option in gnubbyd for such a facility. Maybe it doesn't like something about your Yubikey, or maybe you need to go through some sort of initial setup with it?

@vapier
Copy link
Contributor

vapier commented Feb 5, 2018

in order to access the smartcard connector app, you need to be whitelisted by it first:
https://github.com/GoogleChromeLabs/chromeos_smart_card_connector/blob/master/third_party/pcsc-lite/naclport/server_clients_management/src/known_client_apps.json

further, the way Secure Shell does it is by building an ssh-agent on top of the connection:
https://chromium.googlesource.com/apps/libapps/+/master/nassh/doc/hardware-keys.md

which in turn is not exactly trivial. look at the commits from Fabian here:
https://chromium.googlesource.com/apps/libapps/+log/nassh-0.8.41/nassh/

we might be able to factor out our ssh-agent implementation so it could be pulled into other projects ...

i don't think native messaging will help here.

@qmx
Copy link

qmx commented May 16, 2018

@vapier is there any specific process for getting mosh whitelisted on GSC?

@vapier
Copy link
Contributor

vapier commented May 16, 2018

just send them a PR, and feel free to cc me on it so i can sync up with the Googler internally as needed

@bryanlharris
Copy link

Hello rpwoodbu, I attempted to use this feature to read a yubikey 5. However, I'm not sure whether I'm doing everything right or not. I installed the keys into the card using win4gpg, and successfully connect with gpg-connect-agent with a regular PuTTY session (after saving the pubkey to my authorized_keys file on remote side). However, both Chrome smart card connector as well as Mosh do not appear to read the yubikey. Is there anything I need to do to make this work? Does it only work on a chromebook or does it also work on Windows 10 running regular Chrome? I can access Navy webmail using a CAC, so I assume my Chrome is able to read other smart cards too.

@morfca
Copy link

morfca commented Mar 17, 2019

having similar difficulty with yubikey 5

@tv42
Copy link

tv42 commented Jan 30, 2020

I have a Yubikey 5c nano in PIV mode working well with the SSH app, Mosh doesn't seem to see it at all.

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

7 participants