Last active
August 26, 2025 07:19
-
-
Save mrjk/0b22beb6c48faf14a7785c0e7275c4d6 to your computer and use it in GitHub Desktop.
How to generate ssh_keys with comprehensive comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_IDENT="USER_HOST" | |
_IDENT=$(id -un)_$(hostname -f) | |
_DATE=$(date +'%Y%m%d') | |
_OUT="$(id -un)/.ssh/" | |
_OUT="$(getent passwd "${USER}" | cut -d: -f6)/.ssh/" | |
echo "Ident=$_IDENT, date=$_DATE out=$_OUT" | |
ssh-keygen -t ed25519 -C "${_IDENT}:ed25519_${_DATE}" -f "${_OUT}${_IDENT}_ed25519_${_DATE}" | |
ssh-keygen -t rsa -b 4096 -C "${_IDENT}:rsa4096_${_DATE}" -f "${_OUT}${_IDENT}_rsa4096_${_DATE}" | |
ssh-keygen -t rsa -b 2048 -C "${_IDENT}:rsa2048_${_DATE}" -f "${_OUT}${_IDENT}_rsa2048_${_DATE}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment