4.8 Configure and verify remote device access with SSH
CCNA 200-301 v1.1 · 4.0 IP Services
Managing a device over the network needs an encrypted session: SSH replaces Telnet, which sends passwords in clear text. For the CCNA you configure SSH version 2 on a router or switch from scratch (hostname, domain, keys, local user, VTY lines) and verify that Telnet is refused.
What you must know
- List the steps to enable SSH on IOS in order.
- Generate an RSA key of the right size and force SSH version 2.
- Configure VTY lines with
login localandtransport input ssh. - Give a Layer 2 switch a management address and default gateway.
- Restrict who may connect with an ACL on the VTY lines.
Configure SSH step by step
hostname SW1
ip domain-name example.local
crypto key generate rsa modulus 2048
ip ssh version 2
username admin secret Str0ngPass!
!
line vty 0 15
login local
transport input ssh
exec-timeout 10 0- Set a hostname other than the default and an
ip domain-name: the key is named after both. - Generate the RSA key; 2048 bits is a good choice, and SSHv2 needs at least 768.
- Create a local user with
secret(hashed) rather thanpassword. - On the VTY lines use the local user database and allow only SSH.
Management address on a switch
A Layer 2 switch has no routed ports, so it is managed through an SVI in a management VLAN and needs a default gateway to answer from other subnets.
interface Vlan99
ip address 10.99.0.11 255.255.255.0
no shutdown
ip default-gateway 10.99.0.1The admin's SSH session reaches SW1 through R1 (1); without ip default-gateway the switch could not answer it.
Restrict and verify
ip access-list standard MGMT
permit 10.10.0.0 0.0.0.255
line vty 0 15
access-class MGMT inCommands
show ip ssh | Whether SSH is enabled, its version and timeouts. |
show ssh | Current SSH sessions. |
show users | Who is logged in on which line. |
ssh -l admin 10.99.0.11 | Open an SSH session from IOS (or any client). |
Exam traps
crypto key generate rsafails until a hostname (notSwitch/Router) and a domain name exist.transport input sshblocks Telnet;transport input allallows both.login localuses the username database; plainloginuses the line password.- A Layer 2 switch needs
ip default-gatewayto be managed from another subnet. - The VTY ACL uses
access-class, notip access-group.
Check yourself
- What two settings must exist before you can generate the RSA key?
- A hostname and an IP domain name.
- How do you make sure Telnet is refused on the VTY lines?
transport input ssh.- SSH works from the switch's own VLAN but not from other subnets. What is missing?
ip default-gatewayon the Layer 2 switch.
Labs
Try it live: Secure device access: passwords, SSH, CDP and LLDP
More topics in 4.0 IP Services
- 4.1 Configure and verify NAT for inside hosts using static mappings and address pools
- 4.2 Configure and verify NTP clients and servers
- 4.3 Explain what DHCP and DNS do for hosts
- 4.4 Explain how SNMP is used in network operations
- 4.5 Describe syslog, including facilities and severity levels
- 4.6 Configure and verify DHCP client and relay