16.4.6 Packet Tracer - Configure Secure Passwords and SSH Instructor Version

16.4.6 Packet Tracer - Configure Secure Passwords and SSH
Addressing Table
| Device | Interface | IP Address | Subnet Mask | Default Gateway |
|---|---|---|---|---|
| RTA | G0/0 | 172.16.1.1 | 255.255.255.0 | N/A |
| PCA | NIC | 172.16.1.10 | 255.255.255.0 | 172.16.1.1 |
| SW1 | VLAN 1 | 172.16.1.2 | 255.255.255.0 | 172.16.1.1 |
Scenario
The network administrator has asked you to prepare RTA and SW1 for deployment. Before they can be connected to the network, security measures must be enabled.
Intructions
Step 1: Configure Basic Security on the Router
a. Configure IP addressing on PCA according to the Addressing Table.
b. Console into RTA from the Terminal on PCA.
c. Configure the hostname as RTA.
d. Configure IP addressing on RTA and enable the interface.
e. Encrypt all plaintext passwords.
RTA(config)# service password-encryption
f. Set the minimum password length to 10.
RTA(config)# security passwords min-length 10
g. Set a strong secret password of your choosing.
Note: Choose a password that you will remember, or you will need to reset the activity if you are locked out of the device.
h. Disable DNS lookup.
RTA(config)# no ip domain-lookup
i. Set the domain name to CCNA.com (case-sensitive for scoring in PT).
RTA(config)# ip domain-name CCNA.com
j. Create a user of your choosing with a strong encrypted password.
RTA(config)# username any_user secret any_password
k. Generate 1024-bit RSA keys.
Note: In Packet Tracer, enter the crypto key generate rsa command and press Enter to continue.
RTA(config)# crypto key generate rsa The name for the keys will be: RTA.CCNA.com 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
l. Block anyone for three minutes who fails to log in after four attempts within a two-minute period.
RTA(config)# login block-for 180 attempts 4 within 120
m. Configure all VTY lines for SSH access and use the local user profiles for authentication.
RTA(config)# line vty 0 4 RTA(config-line)# transport input ssh RTA(config-line)# login local
n. Set the EXEC mode timeout to 6 minutes on the VTY lines.
RTA(config-line)# exec-timeout 6
o. Save the configuration to NVRAM.
p. Access the command prompt on the desktop of PCA to establish an SSH connection to RTA.
(Make sure you have IP configured for PCA)
C:\> ssh /?
Packet Tracer PC SSH
Usage: SSH -l username target
C:\>
C:\>SSH -l jony 172.16.1.1
Password: <~~ enter password itexamanswers.netStep 2: Configure Basic Security on the Switch
Configure switch SW1 with corresponding security measures. Refer to the configuration steps on the router if you need additional assistance.
a. Click on SW1 and select the CLI tab.
b. Configure the hostname as SW1.
c. Configure IP addressing on SW1 VLAN1 and enable the interface.
d. Configure the default gateway address.
e. Disable all unused switch ports.
Note: On a switch it is a good security practice to disable unused ports. One method of doing this is to simply shut down each port with the ‘shutdown’ command. This would require accessing each port individually. There is a shortcut method for making modifications to several ports at once by using the interface range command. On SW1 all ports except FastEthernet0/1 and GigabitEthernet0/1 can be shutdown with the following command:
SW1(config)# interface range F0/2-24, G0/2 SW1(config-if-range)# shutdown %LINK-5-CHANGED: Interface FastEthernet0/2, changed state to administratively down %LINK-5-CHANGED: Interface FastEthernet0/3, changed state to administratively down <Output omitted> %LINK-5-CHANGED: Interface FastEthernet0/24, changed state to administratively down %LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to administratively down
The command used the port range of 2-24 for the FastEthernet ports and then a single port range of GigabitEthernet0/2.
f. Encrypt all plaintext passwords.
g. Set a strong secret password of your choosing.
h. Disable DNS lookup.
i. Set the domain name to CCNA.com (case-sensitive for scoring in PT).
j. Create a user of your choosing with a strong encrypted password.
k. Generate 1024-bit RSA keys.
l. Configure all VTY lines for SSH access and use the local user profiles for authentication.
m. Set the EXEC mode timeout to 6 minutes on all VTY lines.
n. Save the configuration to NVRAM.
Device Configs - Final
Router RTA
! ============================================================== !--- 16.4.6 Packet Tracer - Configure Secure Passwords and SSH !--- ANSWER SCRIPT FOR ROUTER RTA !--- Usage: copy this whole file and paste it into the ROUTER RTA terminal (start at the Router> prompt). Every line beginning with "!" is a comment; IOS ignores it, so pasting a comment by accident is harmless. ! ============================================================== enable configure terminal ! -------------------------------------------------------------- !--- Step 1: Configure Basic Security on the Router ! -------------------------------------------------------------- !--- Configure the hostname. hostname RTA !--- Configure the G0/0 IP address and enable the interface. interface g0/0 ip address 172.16.1.1 255.255.255.0 no shutdown exit !--- Encrypt all plaintext passwords. service password-encryption !--- Set the minimum password length to 10 characters. security passwords min-length 10 !--- Set a strong enable secret password (example value from the answer key). enable secret itexamanswers !--- Disable DNS lookup. no ip domain-lookup !--- Set the domain name (case-sensitive - PT grades this exactly). ip domain-name CCNA.com !--- Create a local user with an encrypted secret password (example values; the SSH test logs in as jony). username jony secret itexamanswers.net !--- Generate 1024-bit RSA keys for SSH. IMPORTANT: the '1024' below answers the modulus prompt, so these two lines MUST stay together with NO comment between them. crypto key generate rsa 1024 !--- Block login for 3 minutes after 4 failed attempts within 2 minutes. login block-for 180 attempts 4 within 120 !--- Configure the VTY lines for SSH only, authenticate with local users, and set a 6-minute idle timeout. line vty 0 4 transport input ssh login local exec-timeout 6 exit end ! -------------------------------------------------------------- !--- Save the configuration to NVRAM. (Press Enter when prompted.) ! -------------------------------------------------------------- copy running-config startup-config ! ============================================================== !--- Verification: !--- show ip ssh -> SSH enabled, RSA key present !--- show run | include username -> local user configured !--- (from PCA) SSH -l jony 172.16.1.1 -> SSH login works ! ==============================================================
Switch SW1
! ============================================================== !--- 16.4.6 Packet Tracer - Configure Secure Passwords and SSH !--- ANSWER SCRIPT FOR SWITCH SW1 !--- Usage: copy this whole file and paste it into the SWITCH SW1 terminal (start at the Switch> prompt). Every line beginning with "!" is a comment; IOS ignores it, so pasting a comment by accident is harmless. ! ============================================================== enable configure terminal ! -------------------------------------------------------------- !--- Step 2: Configure Basic Security on the Switch ! -------------------------------------------------------------- !--- Configure the hostname. hostname SW1 !--- Configure the VLAN 1 management IP and enable the interface. interface vlan 1 ip address 172.16.1.2 255.255.255.0 no shutdown exit !--- Configure the default gateway (RTA G0/0). ip default-gateway 172.16.1.1 !--- Disable all unused ports: shut down every port except F0/1 and G0/1. interface range f0/2 - 24, g0/2 shutdown exit !--- Encrypt all plaintext passwords. service password-encryption !--- Set a strong enable secret password (example value from the answer key). enable secret class !--- Disable DNS lookup. no ip domain-lookup !--- Set the domain name (case-sensitive - PT grades this exactly). ip domain-name CCNA.com !--- Generate 1024-bit RSA keys for SSH. IMPORTANT: the '1024' below answers the modulus prompt, so these two lines MUST stay together with NO comment between them. crypto key generate rsa 1024 !--- Create a local user with an encrypted secret password (example values). username admin_switch secret p@ssword !--- Configure the VTY lines for SSH only, authenticate with local users, and set a 6-minute idle timeout. line vty 0 15 transport input ssh login local exec-timeout 6 exit end ! -------------------------------------------------------------- !--- Save the configuration to NVRAM. (Press Enter when prompted.) ! -------------------------------------------------------------- copy running-config startup-config ! ============================================================== !--- Verification: !--- show ip ssh -> SSH enabled, RSA key present !--- show ip interface brief -> VLAN 1 up; F0/2-24, G0/2 down ! ==============================================================

IP configured for PCA




