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)#
相关推荐
XF小冯11 分钟前
Drippingblues靶机通关教程
linux·运维·网络
weixin_446260851 小时前
轻松实现浏览器自动化——AI浏览器自动化框架Stagehand
运维·人工智能·自动化
跟我聊天我会闯红灯3 小时前
如何开发一个运行在windows系统服务器上的服务
运维·服务器·windows
AI云原生4 小时前
2025最新国内服务器可用docker源仓库地址大全(2025年8月更新)
运维·服务器·docker·云原生·容器·kubernetes·serverless
Clownseven4 小时前
Nginx反向代理教程:配置多个网站并一键开启HTTPS (Certbot)
运维·nginx·https
火龙kess5 小时前
Centos-Stream 10 安装教程(2025版图文教程)
linux·运维·centos
涛思数据(TDengine)6 小时前
新客户 | TDengine 时序数据库是怎么在钢厂“撬动”PI 的?
大数据·运维·数据库·时序数据库·tdengine
程序员黄老师8 小时前
Linux tail 命令详解
linux·运维
我怎么又饿了呀9 小时前
Windows&Linux系统 安装 CUDA 和 cuDNN
linux·运维·windows
xybDIY10 小时前
智能云探索:基于Amazon Bedrock与MCP Server的AWS资源AI运维实践
运维·人工智能·aws