Skip to content

Instantly share code, notes, and snippets.

@eqvinox
Created August 30, 2022 17:38
Show Gist options
  • Select an option

  • Save eqvinox/33888990c830ebc82279a51b01413223 to your computer and use it in GitHub Desktop.

Select an option

Save eqvinox/33888990c830ebc82279a51b01413223 to your computer and use it in GitHub Desktop.
Convert OpenSSH public key to H3C/HPE/3Com Comware config format
#!/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