Management Security Commands
Use these commands to generate keys and certificates, which you can do in addition to loading the keys and certificates.
crypto certificate generate
M4250
M4350
This command generates a self-signed certificate for HTTPS. This command lets the CLI enter the Crypto Certificate Generate configuration mode. The generated RSA key for SSL has a length of 2048 bits. Use the exit command to generate the self-signed certificate.
You can generate two certificates (1 and 2).
| Format | crypto certificate {1 | 2} generate |
| Mode | Global Config |
In Crypto Certificate Generate configuration mode, you can configure the following commands and arguments before using the exit command to generate the self-signed certificate and return to the Global Config mode.
| Command | Argument | Description |
|---|---|---|
| common-name | common-name | The fully qualified URL or IP address of the device. If unspecified, this parameter defaults to the lowest IP address of the device (when the certificate is generated). |
| country | country | The country name in 2 characters |
| duration | days | The days range from 30 to 3650 |
| The email address up to 64 characters | ||
| key-generate length | -- | The length of the SSL RSA key, which is 2048 by default |
| location | location | The location or city name up to 64 characters |
| organization-name | organization-name | The organization name up to 64 characters |
| organization-unit | organization-unit | The organization unit up to 64 characters |
| state | state | The name of the state or province up to 64 characters |
Command example:
(NETGEAR Switch)(config)#crypto certificate 1 generate
(NETGEAR Switch)(config-crypto-cert-gen)#?
common-name Specifies the common name.
country Specifies the country name.
do Run Privileged Exec mode commands.
duration Specifies number of days a self-signed
certification would be valid.
email Specifies the contact email address.
exit To exit from the mode.
key-generate Regenerate SSL RSA key. If unspecified defaults to
1024.
location Specifies the location or city name.
organization-name Specifies the organization name
organization-unit Specifies the organization internal unit
show Display Switch Options and Settings.
state Specifies the state or province name.
(NETGEAR Switch)(config-crypto-cert-gen)#
(NETGEAR Switch)(config-crypto-cert-gen)#key-generate 1024
(NETGEAR Switch)(config-crypto-cert-gen)#exit
Certification Generation Successful..
(NETGEAR Switch)(config)#
no crypto certificate generate
This command deletes the specified HTTPS certificate files from the switch, regardless of whether the certificate is self-signed or downloaded from an outside source.
| Format | no crypto certificate {1 | 2} |
| Mode | Global Config |
crypto key generate rsa
M4250
M4350
This command generates an RSA key pair with 1024, 2048 or 3072 bits for SSH. The new key files overwrite any existing generated or downloaded RSA key files.
| Default | 2048 bit |
| Format | crypto key generate rsa {1024 | 2048 | 3072} |
| Mode | Global Config |
no crypto key generate rsa
This command deletes the RSA key files from the switch.
| Format | no crypto key generate rsa |
| Mode | Global Config |
crypto key generate dsa
M4250
M4350
This command generates a DSA key pair with 1024 bits for SSH. The new key files overwrite any existing generated or downloaded DSA key files.
| Default | 1024 bit |
| Format | crypto key generate dsa |
| Mode | Global Config |
no crypto key generate dsa
This command deletes the DSA key files from the switch.
| Format | no crypto key generate dsa |
| Mode | Global Config |
crypto key generate ecdsa
M4250
M4350
This command generates an ECDSA key pair with 256, 384, or 521 bits for SSH. The new key files overwrite any existing generated or downloaded ECDSA key files.
| Default | None |
| Format | crypto key generate ecdsa {256 | 384 | 521} |
| Mode | Global Config |
no crypto key generate ecdsa
This command deletes the ECDSA key files from the switch.
| Format | no crypto key generate ecdsa |
| Mode | Global Config |
crypto certificate request
M4250
M4350
This command generates and displays a certificate request for HTTPS. This command lets the CLI enter the Crypto Certificate Request configuration mode. The certificate request that is generated using this command is sent to the Certification Authority for signing. The certificate request is generated in Base64-encoded X509 format. Use the exit command to generate the request for the self-signed certificate.
Before generating a certificate request, you must first generate a self-signed certificate using the crypto certificate generate command in Global Configuration mode, to sign the certificate request. Be sure to reenter the identical values in the certificate request fields as were entered in the self-signed certificate generated by the crypto certificate generate command. You can request two certificates.
| Format | crypto certificate {1 | 2} request |
| Mode | Global Config |
In Crypto Certificate Request configuration mode, you can configure the following commands and arguments before using the exit command to request the self-signed certificate and return to the Global Config mode.
| Command | Argument | Description |
|---|---|---|
| common-name | common-name | The fully qualified URL or IP address of the device. If unspecified, this parameter defaults to the lowest IP address of the device (when the certificate is generated). |
| country | country | The country name in 2 characters |
| The email address up to 64 characters | ||
| location | location | The location or city name up to 64 characters |
| organization-name | organization-name | The organization name up to 64 characters |
| organization-unit | organization-unit | The organization unit up to 64 characters |
| state | state | The name of the state or province up to 64 characters |
| subject-alternative-name | subjectAltName |
The subject alternative name in the following format: {(DNS:<name>, (IP:<Addr>)} |
Command example:
(NETGEAR Switch)(Config)#crypto certificate 1 request
(NETGEAR Switch)(Config)#crypto certificate 1 request
(NETGEAR Switch)(config-crypto-cert-req)#?
common-name Specifies the common name.
country Specifies the country name.
do Run Privileged Exec mode commands.
email Specifies the contact email address.
exit To exit from the mode.
location Specifies the location or city name.
organization-name Specifies the organization name
organization-unit Specifies the organization internal unit
show Display Switch Options and Settings.
state Specifies the state or province name.
subject-alternative-name Specifies the Subject Alternative Name.
(Routing)(config-crypto-cert-req)# exit
-----BEGIN CERTIFICATE REQUEST-----
MIIBUTCBuwIBAjASMRAwDgYDVQQDDAcwLjAuMC4wMIGfMA0GCSqGSIb3DQEBAQUA
A4GNADCBiQKBgQC+pfOyHFIjXe/2DDwedT1GkZKX8PP1/4F35KyaounA35kHGw9x
+y+lT5hMfOererTbkLdoM8taPOYipv+gJ978DL8tNMBlMJHAcPokAmuv+PDNYaGK
sY1Y+L/Ajge7qh3iCO/HR/wPenKab4fChbyKA5x7GFriPs4YWGxbvlX2wQIDAQAB
oAAwDQYJKoZIhvcNAQELBQADgYEADXHN2ScDYGnHfTrqjl6+5XDJW66Pxi4r/JPs
BVcF+QKrwItwq6AqGwJDHDVYfvc5FGnpW3vYbfovRuSalbNGmS/iUOXmpjYQryQW
AwTt2DTNPxiuZZjumfjT/utWmdFPsaibGyjcZU/HyDDFsrC7ukLWrXro6fbjvxWX
mnxt7FQ=
-----END CERTIFICATE REQUEST-----
The switch supports adding the SAN field to the certificate request. The following sample SAN formats are supported.
DNS:example.com
DNS:*.example.com
DNS:xyz.com,IP:10.10.20.1
DNS.1:myserver.com, DNS.2:xyz.com, IP:10.10.32.1
crypto certificate import
M4250
M4350
This command imports a signed certificate provided by the Certification Authority (CA). The imported certificate must be based on a certificate request created by the crypto certificate request command. To end the session, add a period on a separate line after the input, and press Enter. The signed certificate must contain the switch public key, match the RSA key on the switch, and must be in X509 PEM text format. You can import two certificates.
| Format | crypto certificate {1 | 2} import |
| Mode | Global Config |
Command example:
(NETGEAR Switch)(Config)#crypto certificate 1 import
Please paste the input now, add a period (.) on a separate line after the input, and
press Enter.
-----BEGIN CERTIFICATE-----
MIIBrDCCARWgAwIBAgIJANi+zML5qmloMA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV
BAMMDTEwLjEzMC44Ni4yMTcwHhcNNzAwMTAxMDM0MzM3WhcNNzEwMTAxMDM0MzM3
WjAYMRYwFAYDVQQDDA0xMC4xMzAuODYuMjE3MIGfMA0GCSqGSIb3DQEBAQUAA4GN
ADCBiQKBgQCZsOyuz2MlQ8ab+Y9vcRgqJdakeL8z4XLNRRDlAsNcOE6GXwskDrT8
hx0r7MywrO4J6bPfqG2t63ee3KUyPS+B6OdxwmNycRwbUZabxD87MmBwx9OtUULY
AkNCUKXG6I9kxUXry4CNbOmFtVpTHDr+xqWbmpQemRjB3VpUXOueewIDAQABMA0G
CSqGSIb3DQEBCwUAA4GBAHycAeQZv80Vxcw+hWFNsWePkD6VdM8o3ecV9kcCcFuV
SreKkICC6HBuPKVxqcoVoGbBiRSMGcDJ4XD9vEWWHZv1QiIn8Z1jy+OSpEAruIOi
myM3O5c1eG/4baIci1ccIJgWjwxZwAPd6kz+OtXHhWLn/+Y2akg3sev6oXTLTCsv
-----END CERTIFICATE-----
.
Certificate imported successfully
crypto dhparam size
M4250
M4350
This command sets the Diffie Hellman (DH) parameter. Diffie Hellman parameters are used in the Diffie-Hellman key exchange mechanism that is used while establishing SSL connections. The DH parameters are generated by the switch once and reused for all SSL connections established thereafter. While the DH parameters are being generated, the SSLT admin mode remains disabled operationally.
When the DH parameters are successfully generated, an informational message is logged to inform you that the parameters were generated and the configured DH parameter was applied.
| Default | 1024 bit |
| Format | crypto dhparam size {1024 | 2048} |
| Mode | Global Config |
no crypto dhparam size
This command sets the Diffie Hellman parameter size to the default.
| Format | no crypto dhparam size |
| Mode | Global Config |
crypto key decrypt write
M4250
M4350
This command is the equivalent of the no crypto key encrypt command and is used to decrypt key files with the user-provided passphrase. You select the type of key file that must be decrypted.
| Format | crypto key decrypt write {rsa | dsa | ecdsa | sslt-cert-key {1 | 2} | sslt-client-cert-key {1-8}} passphrase passphrase [encrypted] |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| rsa | The RSA key pair for SSH |
| dsa | The DSA key pair for SSH |
| ecdsa | The ECDSA key pair for SSH |
| sslt-cert-key | The SSL certificate key (1 or 2) |
| sslt-client-cert-key | The SSL client certificate key (from 1 to 8) |
| passphrase | The passphrase, which must be at least 8 characters long |
| encrypted | The password that is entered is encrypted |
crypto key pubkey-chain ssh
M4250
M4350
This command lets you enter the Public Key Configuration mode to manually set public keys for an individual user. After you enter the Public Key Configuration mode, you must enter the keys. When you are done, you must enter exit. You can set keys for either DSA or RSA.
| Format | crypto key pubkey-chain ssh user-key user-name {dsa | rsa} |
| Mode | Global Config |
Command example:
(NETGEAR Switch)(Config)#crypto key pubkey-chain ssh user-key test rsa
(NETGEAR Switch)(config-pubkey-key)#key-String "ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEAvwova0rICLGoTJ46ZMRknjAk8pBEz3Y4DijzV7oim+wW7DI5mFUULI3cT11
1OcjGHeQF03phufEDcK45Cr0nHCD37zDwjN5B2+YFtVq6h4dQGfBFJVnXvJ/PmqDt5iti/jAvRXn4NzHA03byn8
/yHUsrzI6Syd3FZfaBvD+Shxpgx+pZkkLRXHgZlL/s7uxOpu6aWwjhZEZFz5RJX//chT5J3uHn++W9Yt/3CwEen
ZeF4oOwEji5DTnPfkTnHxm8s4NSWHpKYOsN8LW23ooEmU0moRU0KJx7/Zeuw36fI6RvEIFbTmX6a59GRBPpaMh9
bHBAGxDA4X9x5AXTrsqS1Q=="
(NETGEAR Switch)(config-pubkey-key)#exit
no crypto key pubkey-chain ssh
This command erases all the SSH server public key chains or the public key for a specific user.
| Format | no crypto key pubkey-chain ssh user-key [user-name] |
| Mode | Global Config |
show crypto certificate all
M4250
M4350
This command displays the root CA certificate on the switch.
| Format | show crypto certificate all |
| Mode | Privileged EXEC |
Command example:
(NETGEAR Switch)#show crypto certificate all
Root CA Certificate
Storage: nvram:ca_certs.pem
-----BEGIN CERTIFICATE-----
MIID+zCCAmOgAwIBAgIMY4CqkSlO9X3LTPA3MA0GCSqGSIb3DQEBCwUAMBkxFzAV
BgNVBAMTDkxEQVAgU2VydmVyIENBMB4XDTIyMTEyNTExNDQxN1oXDTIzMTEyNTEx
NDQxN1owGTEXMBUGA1UEAxMOTERBUCBTZXJ2ZXIgQ0EwggGiMA0GCSqGSIb3DQEB
AQUAA4IBjwAwggGKAoIBgQDGejUT5V32M6wMyy4XowLTmM95fT9JNW3uFXbsu0zA
goFk3B/3q8LN7JbyQRZlVIeKemuLwH59SVjN2OYe29Fv9VhEbeaP3vOHIvqP8nf+
J6bVTodNH+gK3NTwwdE3kqQJpBCnMgAIiWdBXErwPmEdRN4WAdTAujoQLI3t/Qzx
Gpu1PNsomjJn7EXs8aIaIPN5mwvL+dwtvUwA4Urd11nr+7orZ1vkeH5qzDp5GzeB
yYmorOAWGM3nHaP+AM//0Jx8xQJRe1Cun7GfFJchEVxMxNGqBLC9oYItNReKsKkn
yWRifQ1RibEzmrnomWVZSE5svnYF6GC/Sezg0GkZamgM4DZ/I0fMealtpSyi8S0p
LwfJF/bagFDquPbKANfW4mXq1SpXcxhPgtRoYUXqZgdmKg8TWx8EsNDJ+TNaaMxp
7R3eERBXklt6LVy1AxrItTL7wFJEroq1VigKpVHnsN5AF1X29H0dhxVV56E51aaR
Th7mWh+oux87BP4jDW2ApdkCAwEAAaNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNV
HQ8BAf8EBQMDBwQAMB0GA1UdDgQWBBQbARsw6CqSAH4APL6rRYsx+JSOMjANBgkq
hkiG9w0BAQsFAAOCAYEAJlUaMqURWQp8CbEKkcYeI3jJbxAvFJrB//9YLq838xeD
vnGidioJo/cCOjBQ8ykjjAur817MO1rJesUhA8u/3lFzXkCB1/zbxx9QQXTN7RKQ
6mmRIUkSWwf9nmAtol8SZ9Nb3+HaPUQLGy1b5OEruLWwUTOOGEqVh2RNrDal1W+G
d42+iXiZkTo/R8sOjlHSWbHqk7iaVV7l2iD3nSqJqu4hLgsF4Lzx/9Eel022lVS1
QPCbN1xVkBdNBXoweSBgtI4v5+TI9JFUSU5kJ5rEx1iH5zExFxqD7b0d9m08swsU
EKMLYjHF1vGkhEzbhLRCrayt1lgKfGvdA2Hw8WBWZmKlOx3OaTDcR+icl8Wm3UHL
VzTTq/3rTuY2fF1SDU9inDwseVMwtYCGFDWLiNWYoyCJ01sGU8NeYv79UJ+xZv2a
rSluB3nVmFG7P1hcx910BwkIv746Ox39LXDBV7ZgkCULGw1HPKshOCEWPB7qcpaZ
9sJHksAHZbgOAcVx9ubx
-----END CERTIFICATE-----
Issued by: LDAP Server CA
Valid from Nov 25 11:44:17 2022 GMT to Nov 25 11:44:17 2023 GMT
Subject: /CN=LDAP Server CA
Fingerprint: 786AF58AEDB04A750DF1154933812D0E
show crypto certificate mycertificate
M4250
M4350
This command displays both root SSH certificates on the switch, or just one root SSH certificate as specified by the optional number argument.
| Format | show crypto certificate mycertificate [number] |
| Mode | Privileged EXEC |
Command example:
(NETGEAR Switch)#show crypto certificate mycertificate
-----BEGIN CERTIFICATE-----
MIIBrDCCARWgAwIBAgIJANi+zML5qmloMA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV
BAMMDTEwLjEzMC44Ni4yMTcwHhcNNzAwMTAxMDM0MzM3WhcNNzEwMTAxMDM0MzM3
WjAYMRYwFAYDVQQDDA0xMC4xMzAuODYuMjE3MIGfMA0GCSqGSIb3DQEBAQUAA4GN
ADCBiQKBgQCZsOyuz2MlQ8ab+Y9vcRgqJdakeL8z4XLNRRDlAsNcOE6GXwskDrT8
hx0r7MywrO4J6bPfqG2t63ee3KUyPS+B6OdxwmNycRwbUZabxD87MmBwx9OtUULY
AkNCUKXG6I9kxUXry4CNbOmFtVpTHDr+xqWbmpQemRjB3VpUXOueewIDAQABMA0G
CSqGSIb3DQEBCwUAA4GBAHycAeQZv80Vxcw+hWFNsWePkD6VdM8o3ecV9kcCcFuV
SreKkICC6HBuPKVxqcoVoGbBiRSMGcDJ4XD9vEWWHZv1QiIn8Z1jy+OSpEAruIOi
myM3O5c1eG/4baIci1ccIJgWjwxZwAPd6kz+OtXHhWLn/+Y2akg3sev6oXTLTCsv
-----END CERTIFICATE-----
Issued by: 10.130.86.200
Valid from Jan 1 03:43:37 1970 GMT to Jan 1 03:43:37 1971 GMT
Subject: /CN=10.130.86.200
Fingerprint: 970A9E32A301507C28D1E36805109C77
show crypto dhparam
M4250
M4350
This command displays the Diffie Hellman parameter size that is used by the SSL tunnel.
| Format | show crypto dhparam |
| Mode | Privileged EXEC |
Command example:
(NETGEAR Switch)#show crypto dhparam
DH param size ................ 1024
DH Parameter generation status ........ In progress
show crypto key mypubkey
M4250
M4350
This command displays the SSH certificates on the switch.
| Format | show crypto key mypubkey |
| Mode | Privileged EXEC |
Command example:
(NETGEAR Switch)#show crypto key mypubkey
RSA Key Data:
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAAAgQD1xWi3s2eakSEsmMDoRIF748Q7pChNctFsSJOaD7esTIgGHhfFL3i2EPn
9VOh2A+8tFg2kXaiIzqWzy9kTbhmcn/tCtRyBkvmpLve2z+AKwdHQxO0ZzdLjtTv4/c4XTE4F6jg/LBKdhFb4+q
Gr6PekbGbuMpp4rvJF76r8wXXlsw==
Fingerprint (Hex): MD5:ad:bb:2b:dd:c0:4b:8e:bc:f1:99:35:05:25:00:d5:cd
Fingerprint (Bubble Babble):
xicag-duvek-fulir-lelab-sumyk-selar-suzys-fopum-cavis-gebyh-coxax
DSA Key Data:
ssh-dss
AAAAB3NzaC1kc3MAAACBANrQifFkVewhGrGtOM8tzm1gig7vdp3zRY81jIiQF8ukS8x2f/WDPAu1aZa+wf8pmt0
y+nAv9rPmYTDnM0Ife8X+uu669xd15+FWkrSqe8B6c1NXVDJxDqJIgqOuNjxBj5W+hzwvQODTndVJm9L23hi+0z
xt0DcWfvFVJILFNhjHAAAAFQC00qsPDniPrEn7wNUZH2r2mwGohwAAAIBECr5kreyIwwVBXq05yuSc+khzQ5aDd
HBaEKk4RIqgqXvPUMzyaH/nR84TOX1syUcP5lxK1noo5ayVwUZKp9Gf43NC1KQmq4cI30VsNswvwn6tvm6+Brsw
+DA2KcOxgeGjCZTEZOZXzsqD+OSndE5lo6GBKQdA577NFoo3SzmffwAAAIEA04qsYl2WD1NBf86Ga7kX1EZYPVy
No8tmz3tk899P4VoZFRDw9BzrC/j723Vdl27j0u8oddJKwliXWFSi4nbWg5NdiaSXtBH5v0nzs3GK59QIirXAJp
3ZKMaTzn26PT1emLpw9zxwDpjRLmtpUIKG464KZQwIzSjhcWDJAgDmyVU=
Fingerprint (Hex): MD5:50:4e:c7:aa:ff:41:48:0f:f1:f6:46:4a:1e:db:e2:a7
Fingerprint (Bubble Babble):
xomal-radyc-rebid-hodid-gelos-pekyn-voduz-cidom-damen-mogeb-hoxox
show crypto key pubkey-chain ssh
M4250
M4350
This command displays the SSH client’s public keys on the switch.
Use the optional fingerprint keyword with either the bubble-babble or hex keyword to display the keys per finger print in the bubble babble format or the hexadecimal format.
Use the optional username keyword and associated name argument to display the keys per user name. The fingerprint keyword with either the bubble-babble or hex keyword are optional.
| Format | show crypto key pubkey-chain ssh [fingerprint {bubble-babble | hex} | username name [fingerprint {bubble-babble | hex}]] |
| Mode | Privileged EXEC |
Command example:
(NETGEAR Switch)#show crypto key pubkey-chain ssh
Username Fingerprint
-------------- ---------------------------------------------------------------
test MD5:19:8c:81:e3:cd:5c:2a:8a:91:cb:5e:35:a4:43:93:91