Cisco Systems



Remote access



Configuring Telnet

Remote lines are called line vty. We have 16 lines from 0 to 15

Configuring Telnet server

line vty 0 n
password pass Secure access with a password
login Activate remote access with password authentication
login local Activate remote access with local users accounts authentication

NB:
n= maximum number of simultaneous access
NB : telnet exige la sécurité en mode privilégié

Un switch étant un équipement de niveau 2, i n’a pas d’adresse IP mais on peut créer une interface de niveau 3 sur un switch par : int vlan 1
ip address IP mask
no shutdown

Using command line

telnet IP telnet access telnet IP port access a machine on a port

Telnetting into Multiple Devices Simultaneously

If you telnet to a router or switch, you can end the connection by typing exit at any time. But what if you want to keep your connection to a remote device going while still coming back to your original router console? To do that, you can press the Ctrl+Shift+6 key combination, release it, and then press X. Here’s an example of connecting to multiple devices from my SW-1 console:

SW-1#10.100.128.8
Trying 10.100.128.8... Open
User Access Verification
Password:
SW-3>Ctrl+Shift+6
SW-1#

Here you can see that I telnetted to SW-1 and then typed the password to enter user mode. Next, I pressed Ctrl+Shift+6, then X, but you won’t see any of that because it doesn’t show on the screen output. Notice that my command prompt now has me back at the SW-1 switch. Now let’s run through some verification commands.

Checking Telnet Connections

If you want to view the connections from your router or switch to a remote device, just use the show sessions command. In this case, I’ve telnetted into both the SW-3 and SW-2 switches from SW1:

SW-1#sh sessions
Conn Host Address Byte Idle Conn Name
1 10.100.128.9 10.100.128.9 0 10.100.128.9
* 2 10.100.128.8 10.100.128.8 0 10.100.128.8
SW-1#

Checking Telnet Users

You can reveal all active consoles and VTY ports in use on your router with the show users command:

SW-1#sh users
Line User Host(s) Idle Location
* 0 con 0 10.100.128.9 00:00:01
10.100.128.8 00:01:06

Closing Telnet Sessions

You can end Telnet sessions a few different ways. Typing exit or disconnect are probably the two quickest and easiest. To end a session from a remote device, use the exit command:

SW-3>exit
[Connection to 10.100.128.8 closed by foreign host]
SW-1#

To end a session from a local device, use the disconnect command:

SW-1#sh session
Conn Host Address Byte Idle Conn Name
*2 10.100.128.9 10.100.128.9 0 10.100.128.9

SW-1#disconnect ?
<2-2> The number of an active network connection
qdm Disconnect QDM web-based clients
ssh Disconnect an active SSH connection

SW-1#disconnect 2
Closing connection to 10.100.128.9 [confirm][enter]

In this example, I used session number 2 because that was the connection I wanted to conclude. As demonstrated, you can use the show sessions command to see the connection number.


SSH Configuration

Setting Up Secure Shell (SSH)

I strongly recommend using Secure Shell (SSH) instead of Telnet because it creates a more secure session. The Telnet application uses an unencrypted data stream, but SSH uses encryption keys to send data so your username and password aren’t sent in the clear, vulnerable to anyone lurking around! Here are the steps for setting up SSH:

1. Set your hostname:
Router(config)#hostname Todd

2. Set the domain name—both the hostname and domain name are required for the encryption keys to be generated:
Todd(config)#ip domain-name Lammle.com

3. Set the username to allow SSH client access:
Todd(config)#username Todd password Lammle

4. Generate the encryption keys for securing the session:
Todd(config)#crypto key generate rsa
The name for the keys will be: Todd.Lammle.com
Choose the size of the key modulus in the range of 360 to
4096 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] (elapsed time was 6 seconds)
Todd(config)#
1d14h: %SSH-5-ENABLED: SSH 1.99 has been enabled*June 24
19:25:30.035: %SSH-5-ENABLED: SSH 1.99 has been enabled

5. Enable SSH version 2 on the router—not mandatory, but strongly suggested:
Todd(config)#ip ssh version 2

6. Connect to the VTY lines of the switch:
Todd(config)#line vty 0 15

7. Configure your access protocols:
Todd(config-line)#transport input ssh

Remote using ssh client

ssh -l username IP (on packet tracer)
Example
ssh –l user1 192.168.1.1

Other Configurations

LAB-R2(config)# ip ssh ?
LAB-R2(config)# ip ssh authentication-retries number Specify number of authentication retries
LAB-R2(config)# ip ssh time-out n seconds Specify SSH time-out interval
LAB-R2(config)# ip ssh version version Specify protocol version to be supported

Display Settings

show ip ssh
ip http server
ip http authentication {aaa | enable | local | tacacs}

Configurations
ip http server Enables the HTTP server, including the Cisco web browser user interface
ip http authentication local configure authentication on browser mode from local users

Example
ip http server
ip http authentication local

Eninam BAGNABANA     |         |     bagnadavid@outlook.fr     |