Cisco设置各种密码

设置Console登录

命令如下

sh 复制代码
# 进入console  0
Router(config)#line console 0

# 设置密码
Router(config-line)#password 123456

# 启用登录需要密码
Router(config-line)#login

测试

退出后发现需要密码登录

sh 复制代码
User Access Verification

Password: 
Password: 

关闭密码

sh 复制代码
Router(config-line)#no login

设置进入特权模式的密码(设置进入enable模式密码)

命令

方式一

sh 复制代码
# 用于限制人员访问特权执行模式,密码没有加密,配置文件可以看到
Router(config)#enable password en_pass

方式二(常用)

sh 复制代码
Router(config)#enable secret ?
  0      Specifies an UNENCRYPTED password will follow
  5      Specifies a MD5 HASHED secret will follow
  8      Specifies a PBKDF2 HASHED secret will follow
  9      Specifies a SCRYPT HASHED secret will follow
  LINE   The UNENCRYPTED (cleartext) 'enable' secret
  level  Set exec level password
sh 复制代码
# 经加密,用于限制人员访问特权执行模式,密码已加密,配置文件看不到
Router(config)#enable secret en_secret
Router(config)#

查看配置文件如下

sh 复制代码
Router#show running-config 
Building configuration...

Current configuration : 1346 bytes
!
! Last configuration change at 18:30:12 UTC Sun Nov 12 2023
!
version 15.7
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
enable secret 5 $1$IHgn$b3ydJ0OZovLoELALjiDur/
enable password en_pass
!
no aaa new-model
!
!
!

可以看到enable secret的密码是加密的,当enable secret 和enable password同时存在时候,enable secret设置的密码生效

测试

sh 复制代码
# 从用户模式进入特权模式需要设置密码
Router>enable
Password: 
Password: 

vty密码

用于限制人员通过Telnet访问设备

sh 复制代码
# 配置vty
Router(config)#line  vty 0 4

# 设置Telnet登录密码为vty_pass
Router(config-line)#password vty_pass

# login表示登录时候需要密码验证
Router(config-line)#login
Router(config-line)#
相关推荐
少妇的美梦18 小时前
logstash教程
运维
chen94519 小时前
k8s集群部署vector日志采集器
运维
chen94519 小时前
aws ec2部署harbor,使用s3存储
运维
東雪蓮☆1 天前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
qq_264220891 天前
LVS负载均衡群集和LVS+Keepalived群集
运维·负载均衡·lvs
乌萨奇也要立志学C++1 天前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
雨落Liy1 天前
Nginx 从入门到进阶:反向代理、负载均衡与高性能实战指南
运维·nginx·负载均衡
Yyyy4821 天前
Nginx负载均衡集群实验步骤
运维·nginx·负载均衡
獭.獭.1 天前
Linux -- 信号【上】
linux·运维·服务器
hashiqimiya1 天前
centos配置环境变量jdk
linux·运维·centos