Refresh SSH Keys and Configure Key Options for Management Interface Connection
Table of Contents
9.1 (EoL)
Expand all | Collapse all
End-of-Life (EoL)
Refresh SSH Keys and Configure Key Options for Management Interface Connection
Regenerate SSH keys and configure other key options for
the connection to the management interface on the firewall.
When you verify your Secure
Shell (SSH) connection to the firewall, the verification
uses SSH keys. You can use the CLI to change the default host key
type, generate a new pair of public and private SSH host keys, and
configure other SSH encryption settings.
The following examples
show how to refresh (regenerate) your SSH keys and change various
SSH settings after you access the CLI. The
settings marked as recommended provide a stronger security posture.
If you are using SSH to access the CLI of
the firewall in FIPS-CC mode, you must set automatic rekeying parameters
for session keys.
Palo Alto Networks allows you
to specify only recommended ciphers, key exchange
algorithms, and message authentication algorithms for the
SSH configurations below.
Also note that, to use the same
SSH connection settings for each Dedicated Log Collector (M-Series
or Panorama™ virtual appliances in Log Collector mode) in a Collector Group, you must
configure an SSH service profile from the Panorama management server, Commit the
changes to Panorama, and then Push the configuration
to the Log Collectors. You can use the set log-collector-group <name> general-setting management ssh commands.
Each of the following configuration steps includes
a commit and an SSH service restart if you perform only one step
(except when you create a profile without configuring any settings).
Otherwise, you can set multiple SSH options and then commit your
changes and restart SSH when you’re done.
- (Optional) Set the default
host key type.The firewall uses a default host key type of RSA 2048 unless you change it. The SSH connection uses only the default host key type (not other host key types) to authenticate the firewall. You can change the default host key type; the choices are ECDSA (256, 384, or 521) or RSA (2048, 3072, or 4096).Change the default host key type if you prefer a longer RSA key length or if you prefer ECDSA rather than RSA. This example sets the default host key type to the recommended ECDSA key of 256 bits. It also restarts SSH for the management interface so the new key type takes effect.
- admin@PA-3060> configure
- admin@PA-3060# set deviceconfig system ssh default-hostkey mgmt key-type ECDSA key-length 256
- admin@PA-3060# commit
- admin@PA-3060# exit
- admin@PA-3060> set ssh service-restart mgmt
- admin@PA-3060> configure
- admin@PA-3060# show deviceconfig system ssh default-hostkey
- Establish when automatic rekeying of the session keys
occurs for SSH to the management interface by setting parameters.The session keys are used for encrypting the traffic between the remote device and the management interface on the firewall. After any one rekeying parameter reaches its configured value, SSH uses the new session encryption keys. The parameters are data volume, time interval (seconds), and packet count.If you set more than one parameter, rekeying occurs when the first parameter reaches its configured value and then the firewall resets all rekeying parameters. You can set a second or third parameter in case you aren’t sure that the first parameter you configured will reach its value as fast as you want rekeying to occur.
- admin@PA-3060> configure
- admin@PA-3060# set deviceconfig system ssh session-rekey mgmt data 32Rekeying occurs after the volume of data (in megabytes) is transmitted following the previous rekeying. The default is based on the type of cipher you use and ranges from 1GB to 4GB. The range is 10MB to 4,000MB. Alternatively, you can enter set deviceconfig system ssh session-rekey mgmt data default, which sets the data parameter to the default value of the individual cipher you are using.If you are configuring the management interface connection with encryption in FIPS-CC mode, you must set a data value (you cannot let it default) and the value must be no greater than 1,000MB.
- admin@PA-3060# set deviceconfig system ssh session-rekey mgmt interval 3600Rekeying occurs after the specified time interval (in seconds) passes following the previous rekeying. By default, time-based rekeying is disabled (set to none). The range is 10 to 3,600.If you are configuring the management interface with encryption in FIPS-CC mode, you must set a time interval within the range; you cannot leave it disabled.
- admin@PA-3060# set deviceconfig system ssh session-rekey mgmt packets 27Rekeying occurs after the defined number of packets (2n) are transmitted following the previous rekeying. For example, 14 configures that a maximum of 214 packets are transmitted before a rekeying occurs The range is 12 to 27 (212 to 227); default is 228. Alternatively, you can configure set deviceconfig system ssh session-rekey mgmt packets default, which sets the value to 228.Choose rekeying parameters based on your type of traffic and network speeds (in addition to FIPS-CC requirements if they apply to you). Don’t set the parameters so low that they affect SSH performance.
- admin@PA-3060# commit
- admin@PA-3060# exit
- admin@PA-3060> set ssh service-restart mgmt
- admin@PA-3060> configure
- admin@PA-3060# show deviceconfig system ssh session-rekey mgmt
- (Optional) Set the SSH server to use the specified
encryption ciphers.Using SSH to encrypt your CLI session to the management interface allows all supported ciphers by default. When you set one or more ciphers, the SSH server advertises only those ciphers while connecting and, if the SSH client tries to connect using a different cipher, the server terminates the connection.
- admin@PA-3060> configure
- admin@PA-3060# set deviceconfig system ssh ciphers mgmt cipheraes128-cbc—AES 128-bit cipher with Cipher Block Chainingaes128-ctr—AES 128-bit cipher with Counter Modeaes128-gcm—AES 128-bit cipher with GCM (Galois/Counter Mode)aes192-cbc—AES 192-bit cipher with Cipher Block Chainingaes192-ctr—AES 192-bit cipher with Counter Modeaes256-cbc—AES 256-bit cipher with Cipher Block Chainingaes256-ctr—(Recommended) AES 256-bit cipher with Counter Modeaes256-gcm—(Recommended) AES 256-bit cipher with GCM
- admin@PA-3060# commit
- admin@PA-3060# exit
- admin@PA-3060> set ssh service-restart mgmt
- admin@PA-3060> configure
- admin@PA-3060# show deviceconfig system ssh ciphers mgmt
- (Optional) Delete a cipher from the set of ciphers
you selected to encrypt your CLI session to the management interface.This example deletes the AES CBC cipher with 128-bit key.
- admin@PA-3060> configure
- admin@PA-3060# delete deviceconfig system ssh ciphers mgmt aes128-cbc
- admin@PA-3060# commit
- admin@PA-3060# exit
- admin@PA-3060> set ssh service-restart mgmt
- admin@PA-3060> configure
- admin@PA-3060# show deviceconfig system ssh ciphers mgmt
- (Optional) Set the session key exchange algorithm
for SSH to the management interface.By default, the SSH server advertises all the key exchange algorithms to the SSH client.If you are using an ECDSA default key type, best practice is to use an ECDH key algorithm.
- admin@PA-3060> configure
- admin@PA-3060# set deviceconfig system ssh kex mgmt valuediffie-hellman-group14-sha1—Diffie-Hellman group 14 with SHA1 hashecdh-sha2-nistp256—(Recommended) Elliptic-Curve Diffie-Hellman over National Institute of Standards and Technology (NIST) P-256 with SHA2-256 hashecdh-sha2-nistp384—(Recommended) Elliptic-Curve Diffie-Hellman over NIST P-384 with SHA2-384 hashecdh-sha2-nistp521—(Recommended) Elliptic-Curve Diffie-Hellman over NIST P-521 with SHA2-521 hash
- admin@PA-3060# commit
- admin@PA-3060# exit
- admin@PA-3060> set ssh service-restart mgmt
- (Optional) Set the message authentication code
(MAC) for SSH to the management interface.By default the server advertises all of the MAC algorithms to the client.
- admin@PA-3060> configure
- admin@PA-3060# set deviceconfig system ssh mac mgmt valuehmac-sha1—MAC with SHA1 cryptographic hashhmac-sha2-256—(Recommended) MAC with SHA2-256 cryptographic hashhmac-sha2-512—(Recommended) MAC with SHA2-512 cryptographic hash
- admin@PA-3060# commit
- admin@PA-3060# exit
- admin@PA-3060> set ssh service-restart mgmt
- Regenerate ECDSA or RSA host keys for SSH to replace
the existing keys.The remote device uses the host keys to authenticate the firewall. This example regenerates the ECDSA 256 default host key because that is the default host key type that was set in the first step.Regenerate your default host key at the frequency you determine necessary for security purposes.Regenerating a host key does not change your default host key type. To regenerate the default host key you are using, you must specify your default host key type and length when you regenerate. Regenerating a host key that isn’t your default host key type simply regenerates a key that you aren’t using and therefore has no effect.
- admin@PA-3060> configure
- admin@PA-3060# set deviceconfig system ssh regenerate-hostkeys mgmt key-type ECDSA key-length 256
- admin@PA-3060# commit
- admin@PA-3060> exit
- admin@PA-3060> set ssh service-restart mgmt