Huawei switch

From T2B Wiki
Revision as of 09:15, 18 January 2018 by Rougny Romain rrougny@ua.ac.be (talk | contribs) (Created page with "==== Enable SSH key-based connection ==== <pre>> rsa peer-public-key MYNAME > public-key-code begin</pre> then you need to convert the opennssh ssh-rsa public key to this exa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Enable SSH key-based connection

> rsa peer-public-key MYNAME
> public-key-code begin

then you need to convert the opennssh ssh-rsa public key to this exact format:

ssh-keygen -f id_rsa.pub -e -m pem

Get the text without the surrounding lines

-----BEGIN RSA PUBLIC KEY-----
-----END RSA PUBLIC KEY-----

past it in this website to get it converted into HEX.

The next step is to format it nicely for the switch:

echo "MY-HEX-KEY" | sed 's/.\{8\}/& /g'|fmt -w 44

which should give you something like that:

30820108 02820101 00B9A077 0AE7C1B7
2285F7DC C6D1CDDC 4D18989C D33BA519
...

Past all the lines in the switch interface, then finish the key input with

> public-key-code end
> peer-public-key end

The formatting in 8 characters per packet and 5 packet per line was suggested by the output of

> display rsa local-key-pair public