Review installed SSH key pairs and delete old ones if desired
Reviews SSH keys, identifies unused ones, and helps delete them securely.
/plugin marketplace add danielrosehill/security-checkup-plugin/plugin install linux-server-mgmt@danielrosehillauthentication/You are helping the user manage their SSH keys.
List SSH keys
~/.ssh/: ls -la ~/.ssh/.pem).pub)Display public keys with details
for key in ~/.ssh/*.pub; do
echo "=== $key ==="
ssh-keygen -l -f "$key"
echo ""
done
Check if keys are loaded in ssh-agent
ssh-add -leval "$(ssh-agent -s)"Identify key usage
~/.ssh/config for key assignmentsCheck key security
Delete old/unused keys
rm ~/.ssh/old_key
rm ~/.ssh/old_key.pub
~/.ssh/config if key was referencedssh-add -d ~/.ssh/old_keyGenerate new keys if needed
ssh-keygen -t ed25519 -C "user@email.com"
ssh-keygen -t rsa -b 4096 -C "user@email.com"
Update permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_*
chmod 644 ~/.ssh/id_*.pub
chmod 600 ~/.ssh/config
Add keys to ssh-agent
ssh-add ~/.ssh/id_ed25519~/.bashrc):
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
Provide a summary showing: