1. 使用htpasswd命令生成md5加密密码
[cvsroot@hwdevelop CVSROOT]$ htpasswd
Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password
htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-m Force MD5 encryption of the password.
-d Force CRYPT encryption of the password (default).
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for it.
-D Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.
这里可以直接 ~]$ htpasswd -nb user password
获得加密串 user:RupJuoUbA4HyA
或者通过文件的方式获得加密串 ~]$ htpasswd -cb passtmp user password
passtmp是生成的临时文件。里面存放加密后的密码 用more 察看加密后的密码more passtmp
user:RupJuoUbA4HyA
2. 编辑cvsroot安装目录下CVSROOT子目录中passwd文件 将加密串这一行添加在passwd最后一行即可