Skip to content

Instantly share code, notes, and snippets.

@DarkPark
Last active May 13, 2023 13:02
Show Gist options
  • Save DarkPark/73afdfaafb52020b026dedf872d4e504 to your computer and use it in GitHub Desktop.
Save DarkPark/73afdfaafb52020b026dedf872d4e504 to your computer and use it in GitHub Desktop.
SSH keys

Get fingerprints:

# bash
for file in /etc/ssh/ssh_host_*_key; do ssh-keygen -l -f "$file"; done
# fish
for file in /etc/ssh/ssh_host_*_key; ssh-keygen -l -f "$file"; end

Regenerate keys:

# remove old and unused keys
rm /etc/ssh/ssh_host_*key*
# create new
ssh-keygen -N '' -o -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
ssh-keygen -N '' -o -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -N '' -o -t ecdsa -b 521 -f /etc/ssh/ssh_host_ecdsa_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment