Created
August 30, 2022 17:38
-
-
Save eqvinox/33888990c830ebc82279a51b01413223 to your computer and use it in GitHub Desktop.
Convert OpenSSH public key to H3C/HPE/3Com Comware config format
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/sh | |
| KEYNAME="$1" | |
| PUBKEYFILE="$2" | |
| echo "public-key peer $KEYNAME" | |
| echo "public-key-code begin" | |
| < $PUBKEYFILE ssh-keygen -e -f /dev/stdin -m PKCS8 | openssl pkey -pubin -outform DER | hexdump -e '37/1 "%02X" "\n"' | |
| echo "public-key-code end" | |
| echo "peer-public-key end" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment