Secure Shell (SSH) Commands

Use these M4500 CLI commands to enable SSH, set SSH port, sessions, timeout, and authentication methods, and display SSH settings and public keys.

show ip ssh

This command displays the SSH settings.

Default None
Format show ip ssh
Mode Privileged Exec

Display Message

Parameter Definition
Administrative Mode This field indicates whether the administrative mode of SSH is enabled or disabled.
SSH Port The listen port number of SSH service.
Protocol Levels The protocol level supports.
SSH Sessions Currently Active This field specifies the current number of SSH connections.
Max SSH Sessions Allowed The maximum number of inbound SSH sessions allowed on the switch.
SSH Timeout This field is the inactive timeout value for incoming SSH sessions to the switch.
Keys Present Indicates whether the SSH RSA and DSA key files are present on the device.
Key Generation in Progress Indicates whether RSA or DSA key files generation is currently in progress.
User Password Authentication Indicates whether the SSH authentication mode of user password is enabled or disabled.
User Public Key Authentication Indicates whether the SSH authentication mode of user public key is enabled or disabled.
Terminal Length indicates the number of lines to be paginated and displayed on a screen for a new SSH session.

show ip ssh user-public-key current-user

This command displays the public key content of current login session.

Default None
Format show ip ssh user-public-key current-user
Mode Privileged Exec

Display Message

Parameter Definition
Username Username of current login session.
Key Type Type of user public key. Possible values are DSA or RSA.
Context of Public Key Full context of current user’s public key.

show ip ssh user-public-key who-has-key

This command displays a username list which indicates the owners of public keys, and it only allows user “admin” to execute this command.

Default None
Format show ip ssh user-public-key who-has-key
Mode Privileged Exec

Display Message

Parameter Definition
Public Key Owners A username list which indicates the owners of public keys in this device.

ip ssh

This command is used to enable SSH.

Default Enabled
Format ip ssh
Mode Global Config

no ip ssh

This command is used to disable SSH.

Format no ip ssh
Mode Global Config

ip ssh maxsessions

This command specifies the maximum number of SSH connection sessions that can be established. A value of 0 indicates that no ssh connection can be established. The range is 0 to 5.

Default 5
Format ip ssh maxsessions <0-5>
Mode Global Config

no ip ssh maxsessions

This command sets the maximum number of SSH connection sessions that can be established to the default value.

Format no ip ssh maxsessions
Mode Global Config

ip ssh port

This command specifies the listen port number of SSH service. The range is 1 to 65535.

Default 1234
Format ip ssh port <1-65535>
Mode Global Config

no ip ssh port

This command sets the listen port number of SSH service to the default value.

Format no ip ssh port
Mode Global Config

ip ssh timeout

This command specifies the maximum idle time for each SSH login session. The range is 1 to 160 minutes.

Default 5
Format ip ssh port <1-160>
Mode Global Config

no ip ssh timeout

This command sets the maximum idle time for each SSH login session to the default value.

Format no ip ssh timeout
Mode Global Config

ip ssh user-password-auth

This command is used to enable the SSH authentication mode of user password.

Default Enabled
Format ip ssh user-password-auth
Mode Global Config

no ip ssh user-password-auth

This command is used to disable the SSH authentication mode of user password.

Format no ip ssh user-password-auth
Mode Global Config

ip ssh user-public-key-auth

This command is used to enable the SSH authentication mode of user public key.

Default Disabled
Format ip ssh user-public-key-auth
Mode Global Config

no ip ssh user-public-key-auth

This command is used to disable the SSH authentication mode of user public key.

Format no ip ssh user-public-key-auth
Mode Global Config