Trên GitHub, FiloSottile/yubikey-agent đã đạt 2.9k sao, nhóm Security, ngôn ngữ Go. yubikey-agent is a seamless ssh-agent for YubiKeys.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
yubikey-agent is a seamless ssh-agent for YubiKeys.
Easy to use. A one-command setup, one environment variable, and it just runs in the background.
Indestructible. Tolerates unplugging, sleep, and suspend. Never needs restarting.
Compatible. Provides a public key that works with all services and servers.
Secure. The key is generated on the YubiKey and can't be extracted. Every session requires the PIN, every login requires a touch. Setup takes care of PUK and management key.
Written in pure Go, it's based on github.com/go-piv/piv-go and golang.org/x/crypto/ssh.
Installation
macOS
brew install yubikey-agent
brew services start yubikey-agent
yubikey-agent -setup # generate a new key on the YubiKey
Then add the following line to your ~/.zshrc and restart the shell.
To use yubikey-agent for all hosts but one, you'd add the following lines instead. In both cases, you can keep using ssh-add to interact with the main ssh-agent.
yubikey-agent takes a persistent transaction so the YubiKey will cache the PIN after first use. Unfortunately, this makes the YubiKey PIV and PGP applets unavailable to any other applications, like gpg-agent and Yubikey Manager. Our upstream is investigating solutions to this annoyance.
If you need yubikey-agent to release its lock on the YubiKey, send it a hangup signal or use ssh-add's "delete all identities" flag. Likewise, you might have to kill gpg-agent after use for it to release its own lock.
ssh-add -D
This does not affect the FIDO2 functionality.
Changing PIN and PUK
Use YubiKey Manager to change the PIN and PUK.
yubikey-agent -setup sets the PUK to the same value as the PIN.
If the wrong PIN is entered incorrectly three times in a row, YubiKey Manager can be used to unlock it.
yubikey-agent -setup sets the PUK to the same value as the PIN.
ykman piv access unblock-pin
If the PUK is also entered incorrectly three times, the key is permanently irrecoverable. The YubiKey PIV applet can be reset with yubikey-agent --setup --really-delete-all-piv-keys.
Manual setup and technical details
yubikey-agent only officially supports YubiKeys set up with yubikey-agent -setup.
In practice, any PIV token with an RSA or ECDSA P-256 key and certificate in the Authentication slot should work, with any PIN and touch policy. Simply skip the setup step and use ssh-add -L to view the public key.
yubikey-agent -setup generates a random Management Key and stores it in PIN-protected metadata.
Alternatives
Native FIDO2
Recent versions of OpenSSH support using FIDO2 tokens directly. Since those are their own key type, they require server-side support, which has only recently reached Debian and GitHub.
FIDO2 SSH keys by default don't require a PIN, and require a private key file, acting more like a second factor. yubikey-agent keys always require PINs and can be ported to a different machine simply by plugging in the YubiKey. (With recent enough tokens such as a YubiKey 5, a similar setup can be achieved by using the verify-required and resident options, after setting a FIDO2 PIN with YubiKey Manager: the private key file will still be required, but it can be regenerated from the YubiKey.)
gpg-agent
gpg-agent can act as an ssh-agent, and it can use keys stored on the PGP applet of a YubiKey.
This requires a finicky setup process dealing with PGP keys and the gpg UX, and seems to lose track of the YubiKey and require restarting all the time. Frankly, I've also had enough of PGP and GnuPG.
ssh-agent and PKCS#11
ssh-agent can load PKCS#11 applets to interact with PIV tokens directly. There are two third-party PKCS#11 providers for YubiKeys (OpenSC and ykcs11) and one that ships with macOS (man 8 ssh-keychain).
The UX of this solution is poor: it requires calling ssh-add to load the PKCS#11 module and to unlock it with the PIN (as the agent has no way of requesting input from the client during use, a limitation that yubikey-agent handles with pinentry), and needs manual reloading every time the YubiKey is unplugged or the machine goes to sleep.
The ssh-agent that ships with macOS (which is pretty cool, as it starts on demand and is preconfigured in the environment) also has restrictions on where the .so modules can be loaded from. It can see through symlinks, so a Homebrew-installed /usr/local/lib/libykcs11.dylib won't work, while a hard copy at /usr/local/lib/libykcs11.copy.dylib will.
/usr/lib/ssh-keychain.dylib works out of the box, but only with RSA keys. Key generation is undocumented.
Secretive and SeKey
Secretive and SeKey are similar projects that use the Secure Enclave to store the private key and Touch ID for authorization. The Secure Enclave has so far a worse security track record compared to YubiKeys.
pivy-agent
pivy-agent is part of a suite of tools to work with PIV tokens. It's similar to yubikey-agent, and inspired its design.
The main difference is that it requires unlocking via ssh-add -X rather than using a graphical pinentry, and it caches the PIN in memory rather than relying on the device PIN policy. It's also written in C.
yubikey-agent also aims to provide an even smoother setup process.
FiloSottile/yubikey-agent thuộc nhóm Security trên TopGit, cùng 6 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về FiloSottile/yubikey-agent ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/FiloSottile/yubikey-agent là nguồn chính thức.
FiloSottile/yubikey-agent có bao nhiêu sao?
FiloSottile/yubikey-agent có 2.9k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/FiloSottile/yubikey-agent. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
FiloSottile/yubikey-agent có những chủ đề gì?
GitHub topics của FiloSottile/yubikey-agent: "cryptography", "piv", "smartcard", "ssh", "ssh-agent", "yubikey". TopGit xếp repo vào nhóm Security.
FiloSottile/yubikey-agent có phải mã nguồn mở không?
Có — FiloSottile/yubikey-agent phát hành theo license BSD-3-Clause, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/FiloSottile/yubikey-agent.
FiloSottile/yubikey-agent có trang demo không?
Dự án có trang chủ ở https://filippo.io/yubikey-agent. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
FiloSottile/yubikey-agent còn đang phát triển không?
Commit gần nhất trên FiloSottile/yubikey-agent là 3.0 năm trước (theo timestamp GitHub). Repo có 165 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về yubikey-agent?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về yubikey-agent.