Apache Security-3 Digest Authentication(摘要认证)简介及实战
来源:互联网 发布:淘宝职业打假人被杀 编辑:程序博客网 时间:2024/04/26 19:21
- 说明
- 准备工作
- 需要哪些模块
- 摘要认证Digest Authentication
- 1 摘要认证如何工作
- 2 实战
- 小结
1. 说明
本文系我的"Web Server & Web Technology (WSWT)系列博客之一,主要讲解Linux系统的Apache配置和使用,以及如何使用apache搭建自己的个人网站".该系列博客的总目录参见这里http://blog.csdn.net/u014303046/article/details/73694983。
2. 准备工作
为了方便大家观察效果,我写了几个简单的网页,大家可以在这里下载,不知道为什么不能设成0积分下载,所以也可以到这里免费下载,下载后把文件解压放在某个目录下,比如我放在了/home/zsc/workspace/web/apache_1,然后在下面的Docker命令里使用-v参数把这个目录作为docker容器可访问的数据卷。如果你没有使用Docker,你只需要把下文中对应的DocumentRoot目录修改成你自己的目录就好了。
如果你使用Docker,那么首先需要从你之前保存的镜像(从源码安装好apache的镜像)运行一个容器:
sudo docker run -ti -p 80:80 -v /home/zsc/workspace/web/apache_1/:/web/doc_root --name web apache:v1.0 bash
注意:-v参数用来把Docker宿主主机上的/home/zsc/workspace/web/apache_1目录映射到容器内的/web/doc_root目录,这样就可以在容器内访问该目录及其子目录了。所以我们在下文使用Docker的时候都是用/web/doc_root作为DocumetnRoot目录。
本教程假设你已经学习了前面的教程,并在Docker里或者自己的笔记本电脑或者自己购买的服务器上从源码编译好了apache和PHP。
如果你想使用Docker进行练习但是又没有做好docker的相关镜像,你可以从docker hub 搜索我做好的镜像:leeochang/angryberry,然后直接pull下来,就可以使用了。链接.
修改documentroot:
3. 需要哪些模块
Authentication type (see the AuthType directive)
- mod_auth_basic
- mod_auth_digest
- Authentication provider (see the AuthBasicProvider and
AuthDigestProvider directives)- mod_authn_anon
- mod_authn_dbd
- mod_authn_dbm
- mod_authn_file
- mod_authnz_ldap
- mod_authn_socache
- Authorization (see the Require directive)
- mod_authnz_ldap
- mod_authz_dbd
- mod_authz_dbm
- mod_authz_groupfile
- mod_authz_host
- mod_authz_owner
- mod_authz_user
4. 摘要认证(Digest Authentication)
Basic Authentication 不是一种安全的方式,因此出现了后来的Digest Authentication.
4.1 摘要认证如何工作?
Digest Authentication在基本身份验证上面扩展了安全性. 服务器为每一连接生成一个唯一的随机数, 客户端对用这个随机数对密码进行MD5加密. 然后发送到服务器. 服务器端也用此随机数对密码加密, 然后和客户端传送过来的加密数据进行比较.
Apache HTTP Server对于摘要认证的实现主要依靠mod_auth_digest模块(mod_digest是老版本)。
4.2 实战
- 创建密码文件
cd /etc/apache2/server_root/bin# 格式:./htdigest -c /etc/apache2/password/mydigest realmNmae username./htdigest -c /etc/apache2/password/mydigest testDigest Jack#按要求输入密码./htdigest -c /etc/apache2/password/mydigest testDigest Black#按要求输入密码
然后修改httpd.conf文件的Directory部分:
添加mod_auth_digest模块,然后重启服务器。
在浏览器里输入网址,你会发下和Basic authentication一样浏览器会要求你输入用户名和密码。
和basic authentication一样,你同样可以设置组,方法是一样的,不再赘述。
5. 小结
本文主要介绍了digest authentication,下一个教程将会介绍访问控制的知识。
- Apache Security-3 Digest Authentication(摘要认证)简介及实战
- Apache Security-2-Basic Authentication(基本认证)简介及实战练习
- digest ~ 摘要认证
- 配置Apache服务的basic和digest摘要认证
- ASP.NET Web API(三):安全验证之使用摘要认证(digest authentication)
- ASP.NET Web API:安全验证之使用摘要认证(digest authentication)
- Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结Atitit HT
- http协议之digest(摘要)认证
- iOS中 Http 摘要(DIGEST)认证
- Digest authentication
- Digest authentication
- Digest authentication
- 关于Basic,Digest and NTLM Authentication认证的问题
- HTTP认证模式:Basic and Digest Access Authentication
- Authentication(Spring Security 认证笔记)
- Simple Authentication and Security Layer 简单的认证及加密层
- HTTP 验证 Tomcat中进行基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)
- HTTP 验证 Tomcat中进行基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)
- replace与replaceAll的区别
- Listview的checkbox复用的问题
- vivado点击xsetup.exe没有反应
- 免费馅饼 HDU
- Reverse Integer(leetcode7)
- Apache Security-3 Digest Authentication(摘要认证)简介及实战
- 1387 Decoding Morse Sequences
- CRF++进行自定义命名实体识别
- Web报表系统葡萄城报表:交互式报表
- jQuery ajax
- Python之模块调用
- Ansible安装部署及常用模块详解
- u-boot-2016.09 make编译过程分析(二)
- 面试 冒泡排序