service password-encryption,enable secret,enable password区别

简介:

service password-encryption,enable secret,enable password区别

原创 2014年12月18日 20:05:24

R(config)#service password-encryption //  加密路由器上所有明文口令。

running-config中的密码都不在以明文显示。

如:可使enable console等口令都不可见,需要注意的是这个命令是不可逆的,也就是说你用 no service password-encryption命令后,那些命令的口令还是不可见,只能改密码了。

这种加密算法与用于enable secret命令的散列算法相比可以认为是较弱的,但它比让口令明文存储好。


enable password这种方式是明文的。enable secret是采用了MD5加密的。
service password-encryption这个加密的方式是采用了cisco的私有加密方式来加密的。所以我在设置了vty、console、和AUX口密码的时候,开启service password-encryption,然后你在show run一看,这些接口的password后面都跟有一个数字7,这个数字7就表示是采用了cisco的私有加密算法,是可以逆转的,当然,我们在路由器上面再敲入:no service password-encryption这条命令后,是不可能直接解密的,是通过其他办法解密的。
至于你说的enable password 7,你可以在路由器下面输入这个命令:enable password  ?后面会出现如下:
0      Specifies an UNENCRYPTED password will follow
7      Specifies a HIDDEN password will follow
LINE   The UNENCRYPTED (cleartext) 'enable' password
level  Set exec level password
输入:enable secret ?,出现:
0      Specifies an UNENCRYPTED password will follow
  5      Specifies an ENCRYPTED secret will follow
  LINE   The UNENCRYPTED (cleartext) 'enable' secret
  level  Set exec level password
这里可以这样理解:
0 、5、7的意思是:0为不加密,5为使用MD5加密,7为使用cisco的私有算法加密。
enable password 0 后面可以直接跟加密的内容,这个命令和enable password 一样。
enable password 7后面必须要跟你加密的密码经过思科私有算法出来那个数值。比如,你想把这个密码设置成cisco,那么,你得必须先使用思科的私有算法算出cisco是多少,这里cisco使用思科的算法是060506324F41,即:enable password 060506324F41,然后你不能启用service password-encryption,在这个时候你show run看下,密码是不是cisco?
至于enable secret ,你在这个后面跟上0,也使用MD5加密,并不是明文,在使用enable secret  5 这个后面必须跟上你要使用的密码的MD5算法得出来的数值,并不能对MD5的出来的数值再进行加密。


 1,配置特权视图密码 

A:enable password                            没加密 ,设置VTY登录进入用户模式的密码

B:service password-encryption         对明文密码进行加密

 C:enable secret                                用MD5算法对特权模式进行加密 ,设置从用户模式进入特权模式的密码  


   A 命令: enable password tangxuquan 

   结果: Router#show run

Building configuration... Current configuration : 354 bytes ! 

version 12.2 no service password-encryption ! 

hostname Router ! !

 enable password tangxuquan    密码以明文显示  


   B 命令: 在A的基础上运行 service password-encryption 

   结果: Router#show run 

Building configuration... Current configuration : 354 bytes ! 

version 12.2 service password-encryption ! 

hostname Router ! ! 

enable password 7 08354D400E011006070A02   对明文密码进行了加密  

   

    C 命令:在B命令的基础上运行 enable secret cisco 

    Router#show run 

Building configuration... Current configuration : 401 bytes ! 

version 12.2 service password-encryption ! 

hostname Router ! ! 

enable secret  5  $1$mERr$hx5rVt7rPNoS4wqbXKX7m0     MD5算法的密码显示


 enable password  7  08354D400E011006070A02 用service password-encryption的加密显示。 

 

特别注意: secret 不能和password密码一样 否则就失去了加密的意义, 还有就是2种密码都配置了的话 要登入时系统默认 secret密码生效; 一般建议直接配enable secret-encryption,配了enable secret就看不到enable password了,使用命令enable secret cisco 后特权模式的登录密码将改为“cisco”   

2,远程登录用户设置 line vty 0 4 

VTY是路由器的远程登陆的虚拟端口,0 4表示可以同时打开5个会话;

 switch(config)#enable secret……设置进入特权模式进的密码

 Switch(config)#line vty 0 4 

 Switch(config-line)#password 5ijsj 

 Switch(config)#login

本文转自 9pc9com 博客, 原文链接:   
http://blog.51cto.com/215363/1972731
     如需转载请自行联系原作者
相关文章
|
16天前
|
关系型数据库 MySQL 数据安全/隐私保护
MySQL连接ERROR 2059 (HY000): Authentication plugin ‘caching_sha2_password‘ cannot be loaded
MySQL连接ERROR 2059 (HY000): Authentication plugin ‘caching_sha2_password‘ cannot be loaded
23 0
|
数据安全/隐私保护 Docker 容器
MySQL8.0:报错caching_sha2_password Auth failed
MySQL8.0:报错caching_sha2_password Auth failed
174 0
|
开发工具 数据安全/隐私保护 git
git 报错:Support for password authentication was removed. Please use a personal access token instead.
git 报错:Support for password authentication was removed. Please use a personal access token instead.
341 0
git 报错:Support for password authentication was removed. Please use a personal access token instead.
|
SQL 关系型数据库 MySQL
Access denied for user ‘root‘ @‘123.233.244.218‘(using password:YES)的解决方法
Access denied for user ‘root‘ @‘123.233.244.218‘(using password:YES)的解决方法
170 1
Access denied for user ‘root‘ @‘123.233.244.218‘(using password:YES)的解决方法
|
数据安全/隐私保护
remote: Support for password authentication was removed on August 13, 2021
remote: Support for password authentication was removed on August 13, 2021
142 0
|
XML 分布式计算 Hadoop
hiveserver2连接报错: User: root is not allowed to impersonate anonymous (state=08S01,code=0)
hiveserver2连接报错: User: root is not allowed to impersonate anonymous (state=08S01,code=0)
627 0
|
关系型数据库 MySQL
MySQL 连接出现 Authentication plugin 'caching_sha2_password' cannot be loaded
MySQL 连接出现 Authentication plugin 'caching_sha2_password' cannot be loaded
200 0
No authorization to log on as a Trusted System L-RC=1 T-RC=0
Issue When you test Fiori application, you meet with error message as indicated in the issue title in backend.
190 0
No authorization to log on as a Trusted System L-RC=1 T-RC=0
|
SQL 安全 数据库
The server principal "sa" is not able to access the database "xxxx" under the current security context
在SQL Server服务器上一个作业执行时,遇到下面错误信息: Message: Executed as user: dbo. The server principal "sa" is not able to access the database "xxxx" under the current security context. [SQLSTATE 08004] (Error 916). The step failed.   作业本身执行的存储过程非常简单,就是将数据库A中的历史数据处理过后,归档到A_History库中,结果就遇到这么一个问题。
2853 0
|
关系型数据库 MySQL 测试技术
(28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)
在一台测试服务器测试Python脚本时,执行Python脚本时报如下错误:        主要错误信息为“operation the sql fail!1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)”。
3463 0