modified: n.fq
[GalaxyCodeBases.git] / etc / Server / ssh-keygen / gensshkeys.sh
blob3970226aec785fe2f272b3376bcb9b84b726ce7f
1 #!/bin/sh
3 FULLDATE=`date '+%Y%m%d%H%M%S'`
4 SSHCOMMENT="$(whoami)@$(hostname)-$(date '+%Y%m%d')"
6 ssh-keygen -b 4096 -t rsa -C ${SSHCOMMENT} -N '' -f id_rsa.4k.${FULLDATE}
7 #ssh-keygen -b 3072 -t rsa -C ${SSHCOMMENT} -N '' -f id_rsa.3k.${FULLDATE}
8 ssh-keygen -t ecdsa -b 521 -C ${SSHCOMMENT} -N '' -f id_ecdsa.57.${FULLDATE}
9 ssh-keygen -t ed25519 -C ${SSHCOMMENT} -N '' -f id_ed25519.65.${FULLDATE}
11 ls -l id_*.${FULLDATE}*
12 echo id_*.${FULLDATE} | xargs -n1 ssh-keygen -lf
13 echo id_*.${FULLDATE}.pub | xargs -n1 ssh-keygen -lf
15 # https://www.keylength.com/
16 # https://wiki.archlinux.org/index.php/SSH_keys
17 # https://blog.josefsson.org/2016/11/03/why-i-dont-use-2048-or-4096-rsa-key-sizes/
18 # https://medium.com/@honglong/%E9%81%B8%E6%93%87-ssh-key-%E7%9A%84%E5%8A%A0%E5%AF%86%E6%BC%94%E7%AE%97%E6%B3%95-70ca45c94d8e
19 # echo 4096 | ./keysize-NIST.bc
20 # chmod 700 ~/.ssh ; chmod 600 ~/.ssh/authorized_keys
21 # Changing private key passphrase(overwrite): ssh-keygen -p -f id_ed25519
22 # Print OpenSSH public key: ssh-keygen -y -f id_ed25519