Nexus 5000 SSH Configuration Example [Step by Step]

Requirement: Enable connectivity to Nexus switch

Connectivity to the switch mgmt interface should be established:

– Via mgmt0 interface

– Via the SVI interface

  • Via mgmt0 interface:

The mgmt0 interface on Cisco NX-OS devices provides out-of-band management, which enables you to manage the device by its IPv4 or IPv6 address. The mgmt0 interface uses 10/100/1000 Ethernet.

configure terminal
interface mgmt 0
ip address 192.168.50.10 255.255.255.0
no shutdown
exit

vrf context management
ip route 0.0.0.0/0 192.168.50.254


  • Via SVI interface:
vlan 50
interface Ethernet1/32
  switchport access vlan 50
  speed 1000
  duplex full

feature interface-vlan
interface vlan 50
ip address 192.168.50.10 255.255.255.0
no shutdown
exit

vrf context default
ip route 0.0.0.0/0 192.168.50.254


Step-1: Enable the SSH feature:

switch_N5K# configure terminal
switch_N5K#(config)# feature ssh


Step-2: Generate RSA Key:

switch_N5K#(config)# ssh key rsa 2048

switch_N5K#(config)# exit

switch_N5K# show ssh key

switch_N5K# copy running-config startup-config


Example of show SSH key:

switch_N5K#(config)# show ssh key
rsa Keys generated:Sun May  8 10:02:12 2022
 
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAri3mQy4W1AV9Y2t2hrEWgbUEYzCfTPO5B8LRkedn56BEy2N9ZcdpqE6aqJLZwfZ/
cTFEzaAAZp9AS86dgBAjsKGs7UxnhGySr8ZELv+DQBsDQH6rZt0KR+2Da8hJD4ZXIeccWk0gS1DQUNZ300xstQsYZUtqnx1bvm5/
Ninn0Mc=


Step-3: Specify the SSH public key in Open SSH format:

switch_N5K#(config)# username User1 sshkey ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAri3mQy4W1AV9Y2t2hrEWgbUEYz
CfTPO5B8LRkedn56BEy2N9ZcdpqE6aqJLZwfZcTFEzaAAZp9AS86dgBAjsKGs7UxnhGySr8ZELv+DQBsDQH6rZt0KR+2Da8hJD4Z
XIeccWk0gS1DQUNZ300xstQsYZUtqnx1bvm5Ninn0McNinn0Mc=


Step-4: Save configuration:

switch_N5K(config)# copy running-config startup-config

Bilel Ameur

Enthusiastic Network Engineer specializing in Cisco ACI, passionate about solving challenges. A lifelong learner who loves gaining and sharing knowledge. Profile: https://www.linkedin.com/in/bilel-ameur-71116b2b5
5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x