远程登录
拓补图
R1 192.168.1.1 24 255.255.255.0
PC1 192.168.1.2 255.255.255.0
telnet
R1
基础配置
router> enable
router# config
router(config)# inter g0/0/0
router(config-if)# ip add 192.168.1.1 255.255.255.0
router(config-if)# no sh
router(config-if)# exit
telnet配置
router(config)# enable password zl / 配置特权的密码
router(config)# line vty 0 4 / 进入到vty接口允许5太设备登陆
router(config-line)# password zl / 配置密码进入到vty的密码
router(config-line)# login / 启用密码认证
router(config-line)# exit
PC1
telnet +想要远程登录设备的接口 例:telnet 192.168.1.1
提示password: 输入密码: zl
进入特权 enable 输密码 zl
ssh
R1
router(config)# hoatname R1 / 必须改主机名 ssh
R1(config)#ip domain-name ssh / 创建网络ip域
R1(config)#crypto key generate rsa / 生成加密密钥
How many bits in the modulus [512]: 2048 / 配置密钥长度 越大越优先
R1(config)#enable password /配置特权模式密码
R1(config)#line vty 0 4 / 创建五个登录点
R1(config-line)#login local / 设置本地用户登录
R1(config-line)#transport inpu ssh / 登录模式为ssh登录
R1(config)#username ssh privilege 15 password 12/ 新建用户和密码并给予权限
R1(config)#ip ssh time-out 120 / 配置无操作超时时间为120秒
R1(config)#ip ssh authentication-retries 1 / 修改重认证的次数
PC1
ssh -l +用户名 +要登录设备的端口 例如:ssh -l ssh 192.168.1.1
提示password: 输入密码:zl
进入enable : 输入密码:zl