User Tools

Site Tools


start:cursos:cisco

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
start:cursos:cisco [2026/03/31 12:17] – [IPv6] 192.168.10.1start:cursos:cisco [2026/03/31 14:43] (current) – [Niveles de acceso privilegiado] 192.168.10.1
Line 1331: Line 1331:
 De esta forma, ya no se muestra ninguna contraseña en claro. De esta forma, ya no se muestra ninguna contraseña en claro.
  
 +==== Usuarios ====
  
 +Lo visto hasta ahora era seguridad a nivel de línea, donde todos los administradores usan la misma contraseña, pero también se puede usar seguridad basada en usuarios.
 +
 +```
 +R1(config)#username admin1 secret pass1
 +R1(config)#username admin2 secret pass2
 +R1(config)#line console 0
 +R1(config-line)#login local
 +R1(config)#line vty 0 15
 +R1(config-line)#login local
 +```
 +
 +De eesta forma, usando `login local` en las líneas, ahora forzamos a que se usen usuarios
 +
 +```
 +C:\>telnet 10.0.0.1
 +Trying 10.0.0.1 ...Open
 +User Access Verification
 +Username: admin1
 +Password: <pass1>
 +R1>
 +```
 +
 +==== Niveles de acceso privilegiado ====
 +
 +Hay 16 niveles de acceso privilegiado, del 0 al 15. Por defecto, se accede al nivel 1, que es el nivel de usuario. Se pueden asignar niveles de acceso a los usuarios, y también se pueden definir qué comandos se pueden usar según el nivel de acceso.
 +
 +Por defecto, hay 3 niveles: 0 (que apenas tiene 5 comandos: `logout`, `enable`, `disable`,
 +`help`, y `exit`); el 1, que es el de usuario, y el 15, que es el de administrador.
 +
 +
 +```
 +R1(config)#username admin1 secret secret1
 +R1(config)#username admin2 privilege 15 secret secret2
 +R1(config)#username admin3 privilege 5 secret secret3
 +R1(config)#line console 0
 +R1(config-line)#login local
 +R1(config)#line vty 0 15
 +R1(config-line)#login local
 +```
 +
 +
 +```
 +C:\>telnet 10.0.0.1
 +Trying 10.0.0.1 ...Open
 +User Access Verification
 +Username: admin1
 +Password: <secret1>
 +R1>
 +R1>show privilege
 +Current privilege level is 1
 +
 +R1>show ip interface brief
 +Interface IP-Address OK? Method Status Protocol
 +GigabitEthernet0/0 10.0.0.1 YES manual up up
 +GigabitEthernet0/1 10.0.1.1 YES manual up up
 +GigabitEthernet0/2 unassigned YES unset administratively down down
 +Vlan1 unassigned YES unset administratively down down
 +R1>show run
 +^
 +% Invalid input detected at '^' marker.
 +
 +```
 +
 +```
 +C:\>telnet 10.0.0.1
 +Trying 10.0.0.1 ...Open
 +User Access Verification
 +Username: admin3
 +Password: <secret3>
 +R1>show ip interface brief
 +Interface IP-Address OK? Method Status Protocol
 +GigabitEthernet0/0 10.0.0.1 YES manual up up
 +GigabitEthernet0/1 10.0.1.1 YES manual up up
 +GigabitEthernet0/2 unassigned YES unset administratively down down
 +Vlan1 unassigned YES unset administratively down down
 +R1>show run
 +^
 +% Invalid input detected at '^' marker.
 +
 +```
 +
 +
 +
 +```
 +C:\>telnet 10.0.0.1
 +Trying 10.0.0.1 ...Open
 +User Access Verification
 +Username: admin2
 +Password: <secret2>
 +R1#
 +R1#show privilege
 +Current privilege level is 15
 +
 +R1#sh run
 +Building configuration...
 +Current configuration : 1380 bytes
 +version 15.1
 +!
 +R1#configure terminal
 +R1(config)#
 +```
 +
 +Si añadimos un privilegio al nivel 5:
 +
 +```
 +R1(config)#privilege exec level 5 show running-config
 +```
 +
 +
 +```
 +C:\>telnet 10.0.0.1
 +Trying 10.0.0.1 ...Open
 +User Access Verification
 +Username: admin3
 +Password: <secret3>
 +R1#sh run
 +Building configuration...
 +Current configuration : 1380 bytes
 +version 15.1
 +!
 +R1#configure terminal
 +^
 +% Invalid input detected at '^' marker.
 +```
 +
 +También se pueden establecer contraseñas para los niveles. Si no se especifica nivel, es el 15:
 +
 +```
 +R1(config)#enable secret secret1
 +R1(config)#enable secret level 5 secret2
 +```
 +
 +```
 +C:\>telnet 10.0.0.1
 +Trying 10.0.0.1 ...Open
 +User Access Verification
 +Username: admin1
 +Password: <secret1>
 +R1>show run
 +^
 +% Invalid input detected at '^' marker.
 +R1>enable 5
 +Password: <secret2>
 +R1#show run
 +Building configuration...
 +Current configuration : 1380 bytes
 +!
 +version 15.1
 +no service timestamps log datetime msec
 +no service timestamps debug datetime msec
 +no service password-encryption
 +!
 +hostname R1
 +```
 +
 +==== Acceso SSH ====
 +
 +Para configurar el acceso por SSH, primero hay que generar una clave RSA en el servidor de al menos 768 bits. Esto se hace con `ip domain-name <dominio>` y `crypto key generate rsa`, donde se nos pregunta por la longitud:
 +
 +
 +```
 +R1(config)#ip domain-name flackbox.com
 +R1(config)#crypto key generate rsa
 +The name for the keys will be: R1.flackbox.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]: 768
 +% Generating 768 bit RSA keys, keys will be non-
 +exportable...[OK]
 +```
 +
 +SSh usa la misma línea que Telnet, pero con la directiva `transport input <protocolo>`, se puede elegir `ssh`, `telnet`, `all` o `none`. También conviene especificar que se use la versión 2.
 +
 +
 +```
 +R1(config)#username admin secret secret1
 +R1(config)#line vty 0 15
 +R1(config-line)#transport input ssh
 +R1(config-line)#login local
 +R1(config-line)#exit
 +R1(config)#ip ssh version 2
 +
 +```
 +
 +Luego, desde cualquier cliente ssh:
 +
 +```
 +C:\> ssh –l admin 10.0.0.1
 +Open
 +Password: <secret1>
 +R1>
 +```
start/cursos/cisco.1774959463.txt.gz · Last modified: 2026/03/31 12:17 by 192.168.10.1