Chinaunix首页 | 论坛 | 博客
  • 博客访问: 647371
  • 博文数量: 137
  • 博客积分: 6189
  • 博客等级: 准将
  • 技术积分: 1559
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-15 16:39
文章分类

全部博文(137)

文章存档

2010年(3)

2009年(1)

2008年(49)

2007年(56)

2006年(28)

分类: LINUX

2008-07-24 09:07:31

httpd.conf里富加需要密码验证的目录:
   #目录路径
AllowOverride authconfig
AuthName "yucheng's soft"           #显示的标题
AuthType Basic
AuthUserFile /usr/local/apache/conf/pd.txt    #密码路径
require user admin                           #允许登录的用户名字



再利用htpasswd生成密码

/usr/local/apache/bin/htpasswd -c /usr/local/apache/conf/pd.txt admin

[root@localhost conf]# htpasswd --help
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.
阅读(1556) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~