-
-
Save dirkakrid/0b0b554e91c97f4ab7f178fa094b9dd0 to your computer and use it in GitHub Desktop.
Used to generate max-length SSH keys for TMate
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
| #!/bin/bash | |
| gen_key() { | |
| bits=4096 | |
| keytype=$1 | |
| ks="${keytype}_" | |
| key="keys/ssh_host_${ks}key" | |
| if [ ! -e "${key}" ] ; then | |
| if [ "${keytype}" = 'dsa' ] ; then | |
| bits=1024 | |
| elif [ "${keytype}" = 'ecdsa' ] ; then | |
| bits=521 | |
| fi | |
| ssh-keygen -t ${keytype} -f "${key}" -b $bits -N '' | |
| return $? | |
| fi | |
| } | |
| mkdir -p keys | |
| gen_key dsa && gen_key rsa && gen_key ecdsa || exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment