Secure Shell (SSH) Configuration On A Switch and Router in Packet Tracer
Secure Shell (SSH) Configuration On A Switch and Router in Packet Tracer
Welcome to this tutorial! Here, we’ll have an overview of Secure Shell (SSH)
protocol, then see how to configure it on a switch and a router in Packet Tracer.
An overview of SSH
Secure Shell, just like Telnet, enables a user to access a remote device and manage
it remotely. However, with SSH, all data transmitted over a network (including
usernames and passwords) is encrypted and secure from eavesdropping.
SSH is a client-server protocol, with a SSH client and a SSH server. The client
machine (such as a PC) establishes a connection to a SSH server running on a
remote device (such as a router). Once the connection has been established, a
network admin can execute commands on the remote device.
For this tutorial, we’ll configure SSH on the router so that you as the admin can
access and manage it remotely using an SSH client on the admin PC.
Router(config)#int fa0/0
Router(config-if)#no shut
Router(config)#exit
Router(config)#hostname myRouter
Both the hostname and domain name will be used in the process of generating
encryption keys.
3. Now generate encryption keys for securing the session using the
command crypto key generate rsa.
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.
Note that this password is not for use with SSH; its only for use in accessing
the privileged executive mode of the router after you are able to access its CLI
remotely via SSH .
The password will have to be provided before you can access the CLI of the router
when using SSH.
7.Now connect to VTY lines of the Router and configure the SSH protocol.
myRouter(config)#line vty 0 15
myRouter(config-line)#login local
That’s all for configuration. Move on to see if you can access the router remotely
from the PC.
8. On the command prompt of the PC, open a SSH session to the remote router by
typing the command: ssh -l admin 10.0.0.1
9. Provide the login password which you set in step 5 and press enter. You’re now
probably in the CLI of the router. Provide the enable password (the one you set in
step 4) to access the privileged executive mode.
You can proceed and do configurations on the Router.You’re now managing the
router remotely from the PC.
That’s it!
Here, we’ll configure SSH on a multi-layer switch. The commands remain almost the
same as for the router; only that in a switch, we’ll use the IP address of its VLAN
interface to access it from the PC.
Switch
Switch(config)#int vlan 1
Switch(config-if)#no shut
Now, to configure SSH on the multilayer switch, here are the steps.
1.Configure hostname
Switch(config)#hostname SW1
Both the host name and domain name will be used in the process of generating
encryption keys.
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.
Again, note that enable password is not necessarily used in configuring SSH; it will
allow the admin to access the privileged executive mode of the switch once a
remote connection to the switch via SSH is established.
7. Now connect to the VTY lines of the switch and configure SSH on the lines.
SW1(config)#line vty 0 15
That’s all for SSH configuration on the switch. Move on and try to access the switch
remotely from the PC.
So then:
8. On the command prompt of the Admin PC, open a SSH session to the switch
using the command ssh -l admin 10.0.0.1
Note that: admin is the username defined in step 5 while 10.0.0.1 is the IP address
of the VLAN interface of then switch.
***command prompt***
Note:
We used a multi layer switch because we couldn’t find support for SSH on layer 2
switches in Packet Tracer.
We can still start a SSH session to a router/switch from another router/switch
instead of a PC, as long as the router/switch supports SSH.