ssh configuration on switch

Posted: March 30, 2015 in CCNA
Tags:

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 but 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>enable

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 192.168.1.1 255.255.255.0

S1(config-if)#no shut

S1(config-if)#exit

S1(config)#line vty 0 5

S1(config-line)#password redhat123

S1(config-line)#login

S1(config-line)#

 

Now for ssh configuration below steps are must:

S1>enable

S1#config t

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

S1(config)#ip domain name shivangi

S1(config)#crypto key gene

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 192.168.1.1

Open

Password:

 

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

S1(config-line)#

 

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

PC>ssh -l satish 192.168.1.1

Open

Password:

S1>show arp

Protocol Address Age (min) Hardware Addr Type Interface

Internet 192.168.1.1 – 0001.43A9.275D ARPA Vlan1

Internet 192.168.1.3 30 00E0.F940.4904 ARPA Vlan1

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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