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

如需转载请自行联系原作者


相关文章
|
1月前
|
关系型数据库 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
30 0
|
9月前
|
NoSQL Redis 数据安全/隐私保护
AUTH
AUTH
144 0
|
11月前
|
关系型数据库 MySQL 数据库
mysql8.0 docker部署后连接报错caching_sha2_password could not be loaded
切记:一般情况下不建议使用容器方式部署数据库,此方式只是为了验证一些mysql8.0的特性,做学习和测试使用。
68 0
|
数据安全/隐私保护 Docker 容器
MySQL8.0:报错caching_sha2_password Auth failed
MySQL8.0:报错caching_sha2_password Auth failed
193 0
|
开发工具
Missing value auth-url required for auth plugin password
Missing value auth-url required for auth plugin password
548 0
Missing value auth-url required for auth plugin password
|
关系型数据库 MySQL
MySQL 连接出现 Authentication plugin 'caching_sha2_password' cannot be loaded
MySQL 连接出现 Authentication plugin 'caching_sha2_password' cannot be loaded
204 0
|
Web App开发 Java
利用Basic authentication 测试不同user的metadata access request
Created by Jerry Wang, last modified on Dec 26, 2014
123 0
利用Basic authentication 测试不同user的metadata access request
|
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库中,结果就遇到这么一个问题。
2859 0
|
SQL 存储 安全
SQL Agent Job 报“Access to the remote server is denied because the current security context is not trusted”
SQL Server 2005(Microsoft SQL Server 2005 - 9.00.5000.00)下的一个作业执行一个存储过程,存储过程中动态SQL语句使用链接服务器(Linked Servers),从另外一台SQL Server服务器获取数据。
1317 0
|
数据库连接
SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required
获取数据库连接失败! java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required at com.
8884 0