ssh configuration on switch

Posted: 30 Mar 2015 in CCNA

Learn how to configure ssh on a switch.ssh is used to remote login  to a device pc server switch or router securely.The difference between ssh and telnet is that in telnet username and password is sent on line in simple text form while in ssh it is encrypted and hence make ssh more secure.

ssh configuration on switch

Learn how to configure ssh on a cisco switch in few simple steps:



Switch#config t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname S1

S1(config)#interface vlan 1

S1(config-if)#ip address

S1(config-if)#no shut


S1(config)#line vty 0 5

S1(config-line)#password redhat123




Now for ssh configuration below steps are must:



S1#config t

Enter configuration commands, one per line. End with CNTL/Z.

S1(config)#ip domain name shivangi

S1(config)#crypto key generate rsa

The name for the keys will be: S1.shivangi

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.

How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

S1(config)#ip ssh version 2

*Mar 1 0:21:8.384: %SSH-5-ENABLED: SSH 1.99 has been enabled

S1(config)#line vty 0 5

S1(config-line)#transport input ssh



Now check your ssh connection from any of your pc.


PC>ssh -l admin




Now if you want to change username from admin to something else you can do that from entering switch global configuration mode:

S1(config)#username satish secret redhat

S1(config)#line vty 0 5

S1(config-line)#login local



Now test it from any of your pc by logging through your newly created user:


PC>ssh -l satish



S1>show arp

Protocol Address Age (min) Hardware Addr Type Interface

Internet - 0001.43A9.275D ARPA Vlan1

Internet 30 00E0.F940.4904 ARPA Vlan1

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s