Skip to content

Instantly share code, notes, and snippets.

View keysie's full-sized avatar

Keysie keysie

View GitHub Profile
@Kranzes
Kranzes / guide.md
Last active May 20, 2025 20:38
SSH Resident Key Guide

Initial checks

Start by checking that there aren't any previous ssh keys inside the FIDO2 authenticator of your YubiKey. You can check if they exist by running the command below:

nix shell nixpkgs#yubikey-manager -c ykman fido credentials list

If the command above outputs a string mentioning "ssh" or "openssh", then you have already got a key generated and store on your YubiKey.

Evaluating additional authentication factors

Before generating a new ssh key to store on your YubiKey you must consider which additional required authentication factors you want to use. Below you can see a table with the available factors and their corresponding command:

@tomquisel
tomquisel / findagent
Created February 7, 2015 00:00
find ssh agent socket
function findagent {
if ssh-add -l; then
echo "Your SSH Agent is already working."
return 0
fi
for sock in `ls /tmp/ssh-*/agent.*`; do
export SSH_AUTH_SOCK=$sock
if ssh-add -l; then
echo "Your SSH Agent is fixed. New socket=$sock."
return 0