I deleted all my SSH keys

(blog.infected.systems)

45 points | by speckx 4 days ago

6 comments

  • Foxboron 1 minute ago
    > You will notice though that the private keyfile held on disk uses a .tpm extension this time. This is where an important caveat of the TPM method comes in – Unlike the YubiKey approach, the private key material is actually being stored on disk here. This is because TPM devices do not natively support enrolling SSH keys. So what is happening is that the private key material is being stored on disk in encrypted form, and the TPM is being used to decrypt it.

    While this is true, you can create static hierarchy keys that would not resolve into separate key files for the TPM. The issue here is that anyone with access to your TPM can recreate the keys, unless you set a owner password.

    https://man.archlinux.org/man/ssh-tpm-agent.1#Hierarchy_keys

  • aorth 5 minutes ago
    Great article! I discovered ssh-tpm-agent last year and was surprised that all my ThinkPads have hardware TPM, even one from 2018! I've switched over to using it for everything and there are no more private keys on my devices.

    I also have a Yubikey but it's been a few years since I tried it for ssh keys. I use it as a regular security key. Maybe I should try it for ssh keys as it sounds like the tooling has improved.

  • Bender 4 minutes ago
    I will stick with ssh keys, except that I:

    - Put the public authorized keys in /etc/ssh/keys/%u immutable, monitored for checksum changes.

    - Have CIDR restrictions in said public keys.

        from="x.x.x.x/n,x.x.x.x/n" ssh-ed25519 AAAA[snip] Text-Identifier
    
    - Have NFTables checks for MSS, TCP SYN TTL, Window sizes, CIDR blocks permitted on the public ssh instances (throw away nodes) and behind a VPN on more important roles.
  • entrope 3 minutes ago
    My sticking point with these has always been SSH agent support: the last time I looked, I couldn't use my Yubikey to authenticate the second hop in an A->B->C sequence with a jump box in the middle. Is that resolved now? This blog doesn't address that use case.
  • luz666 16 minutes ago
    How are those compared to nitrokeys? I know an IT guy that prefers those, I think he mentioned those are open hardware?
  • mrlonglong 4 days ago
    Can yubikeys be used for logging onto Linux consoles?
    • ycombinatrix 4 days ago
      Yes, via PAM. I use the rssh module myself.
      • mrlonglong 3 days ago
        Nice thanks, I'm getting one to play with.
        • ycombinatrix 11 hours ago
          It's great, I'm completely done with passwords in Linux.
          • hoppp 14 minutes ago
            Do you have a backup yubi key? So it's a good idea to buy 2?
          • project2501a 35 minutes ago
            Thanks for the info, I have ubiqeys but i did not where to start!