思科路由器:开启telnet和ssh远程登陆

在这里插入图片描述

给路由器配置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#

开启ssh配置登陆密码


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]

验证telnet登陆,在PC1中

C:\>ssh
Packet Tracer PC SSH
Usage: SSH -l username target
C:\>ssh -l R1 10.1.1.254
Password: 123456  # ssh密码
R1>en
Password: feifei
R1#
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

亦良Cool

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值