Cisco Switch Ssh und Telnet: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „=Telnet aktivieren= *Switch#configure terminal *Switch(config)#aaa new-model *Switch(config)#username admin password 0 geheim *Switch(config)#line vty 0 4 *Sw…“)
 
 
(7 dazwischenliegende Versionen von einem anderen Benutzer werden nicht angezeigt)
Zeile 1: Zeile 1:
 
=Telnet aktivieren=
 
=Telnet aktivieren=
*Switch#configure terminal  
+
*c3750#configure terminal
*Switch(config)#aaa new-model
+
*c3750(config)#aaa new-model
*Switch(config)#username admin password 0 geheim
+
*c3750(config)#username admin password 0 geheim
*Switch(config)#line vty 0 4
+
*c3750(config)#line vty 0 4
*Switch(config-line)#transport input telnet
+
*c3750(config-line)#transport input telnet
 
=SSH aktivieren=
 
=SSH aktivieren=
*Switch(config)#ip domain-name xinux.org
+
*c3750(config)#ip domain-name xinux.org
*Switch(config)#hos
+
*c3750(config)#crypto key generate rsa
*Switch(config)#hostname c3750g
 
*c3750g(config)#
 
*c3750g(config)#crypto key generate rsa
 
 
<pre>
 
<pre>
The name for the keys will be: c3750g.xinux.org
+
The name for the keys will be: c3750.xinux.org
 
Choose the size of the key modulus in the range of 360 to 2048 for your
 
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
 
   General Purpose Keys. Choosing a key modulus greater than 512 may take
Zeile 20: Zeile 17:
 
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]
 
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]
 
</pre>
 
</pre>
*c3750g(config)#ip ssh time-out 60
+
*c3750(config)#ip ssh time-out 60
*c3750g(config)#ip ssh authentication-retries 2
+
*c3750(config)#ip ssh authentication-retries 2
 +
 
 +
==ssh key löschen==
 +
 
 +
*c3750(config)#crypto key zeroize
 +
 
 +
=auto exec=
 +
*switch-rot(config)#aaa new-model
 +
*switch-rot(config)#aaa authorization exec default local
 +
 
 
=Abschalten von telnet=
 
=Abschalten von telnet=
*c3750g#configure terminal  
+
*c3750#configure terminal
 +
Enter configuration commands, one per line.  End with CNTL/Z.
 +
*c3750(config)#line vty 0 4
 +
*c3750(config-line)#transport input ssh
 +
 
 +
 
 +
 
 +
=Wrap the key onto multiple lines=
 +
*root@rome:~# fold -b -w 72 ~/.ssh/id_rsa.pub
 +
 
 +
*c3750#configure terminal 
 
  Enter configuration commands, one per line.  End with CNTL/Z.
 
  Enter configuration commands, one per line.  End with CNTL/Z.
*c3750g(config)#line vty 0 4
+
*c3750(config)#ip ssh pubkey-chain
*c3750g(config-line)#transport input ssh
+
*c3750(conf-ssh-pubkey)# username admin
 +
*c3750(conf-ssh-pubkey-user)#
 +
key-string
 +
<< paste your multi-line public key here >>
 +
exit
 +
 
 +
=Change Default SSH Port=
 +
*c3750(config)# ip ssh port 2222 rotary 1
 +
*c3750(config)# line vty 0 15
 +
*c3750(config-line)# rotary 1

Aktuelle Version vom 13. November 2018, 15:32 Uhr

Telnet aktivieren

  • c3750#configure terminal
  • c3750(config)#aaa new-model
  • c3750(config)#username admin password 0 geheim
  • c3750(config)#line vty 0 4
  • c3750(config-line)#transport input telnet

SSH aktivieren

  • c3750(config)#ip domain-name xinux.org
  • c3750(config)#crypto key generate rsa
The name for the keys will be: c3750.xinux.org
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]: 
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]
  • c3750(config)#ip ssh time-out 60
  • c3750(config)#ip ssh authentication-retries 2

ssh key löschen

  • c3750(config)#crypto key zeroize

auto exec

  • switch-rot(config)#aaa new-model
  • switch-rot(config)#aaa authorization exec default local

Abschalten von telnet

  • c3750#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
  • c3750(config)#line vty 0 4
  • c3750(config-line)#transport input ssh


Wrap the key onto multiple lines

  • root@rome:~# fold -b -w 72 ~/.ssh/id_rsa.pub
  • c3750#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
  • c3750(config)#ip ssh pubkey-chain
  • c3750(conf-ssh-pubkey)# username admin
  • c3750(conf-ssh-pubkey-user)#
key-string
<< paste your multi-line public key here >>
exit

Change Default SSH Port

  • c3750(config)# ip ssh port 2222 rotary 1
  • c3750(config)# line vty 0 15
  • c3750(config-line)# rotary 1