思科路由器:開啟telnet和ssh遠端登陸

spokes發表於2020-10-27

在這裡插入圖片描述

給路由器配置IP

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface GigabitEthernet0/0/1
Router(config-if)#ip address 10.1.1.254 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#

開啟telnet配置登陸密碼

Router#enable 
Router#conf te
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line vty 0?
<0-15>  
Router(config)#line vty 0 3     #3表示3個使用者可以同時登陸
Router(config-line)#pass
Router(config-line)#password 123456    #telnet密碼
Router(config-line)#login       #允許登陸
Router(config-line)#exit
Router(config)#
Router(config)#enable password feifei    #特權模式密碼
Router(config)#
Router(config)#exit 
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#write    #儲存
Building configuration...
[OK]

驗證telnet登陸

在PC1中


Packet Tracer PC Command Line 1.0
C:\>ping 10.1.1.254

Pinging 10.1.1.254 with 32 bytes of data:

Reply from 10.1.1.254: bytes=32 time<1ms TTL=255
Reply from 10.1.1.254: bytes=32 time<1ms TTL=255
Reply from 10.1.1.254: bytes=32 time<1ms TTL=255
Reply from 10.1.1.254: bytes=32 time<1ms TTL=255

Ping statistics for 10.1.1.254:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms


C:\>telnet 10.1.1.254
Trying 10.1.1.254 ...Open


User Access Verification

Password: 123456  #輸入telnet密碼
Router>
Router>
Router>en
Router>enable 
Password: feifei  #輸入特權模式密碼
Router#

Router#enable 
Router#conf te
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line vty 0?
<0-15>  
Router(config)#line vty 0 3     #3表示3個使用者可以同時登陸
Router(config-line)#transport input ssh
Router(config-line)#password 123456    #telnet密碼
Router(config-line)#login       #允許登陸
Router(config-line)#exit
Router(config)#
Router(config)#enable password feifei    #特權模式密碼
Router(config)#
Router(config)#exit 

Router(config)#line vty 0 3
Router(config-line)#transport input ssh
Router(config-line)#exit


Router(config)#hos        
Router(config)#hostname R1     #給路由器配置名字
Router(config)#ip domain-name r1.pokes.com     #給路由器配置域名
R1(config)#crypto key generate rsa     #生成金鑰
The name for the keys will be: R1.r1.pokes.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]: 回車
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]

相關文章