Socks5和HTTP代理实现PAM+OpenLDAP用户认证
来源:互联网 发布:织梦cms 地区分站 编辑:程序博客网 时间:2024/06/06 05:47
本文描述了Socks5代理SS5及HTTP代理Squid,通过PAM使用OpenLDAP完成用户认证的配置说明。
共分三部分,第一部分是PAM和OpenLDAP的配置;第二部分是在一的基础之上,如何配置SS5部分;第三部分是在一的基础之上,如何配置Squid部分。
第一部分是基础,二、三部分互相独立,但都需要基于第一部分的配置。
一、PAM + OpenLDAP的配置
配置前,需要在pam所在服务器安装OpenLDAP相关的client端工具。
yum install nss-pam-ldapd pam_ldap openldap-clients -y
##/etc/pam.d/authconfig 配置文件
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#%PAM-1.0
auth include config-util
account include config-util
session include config-util
##/etc/pam.d/config-util 配置文件
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#%PAM-1.0
auth sufficient pam_rootok.so
auth sufficient pam_timestamp.so
auth sufficient pam_ldap.so
auth include system-auth
account required pam_permit.so
session required pam_permit.so
session optional pam_xauth.so
session optional pam_timestamp.so
##/etc/pam_ldap.conf 配置文件
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# host 127.0.0.1
# OpenLDAP server IP
host 192.168.71.100
# The distinguished name of the search base.
#base dc=example,dc=com
base dc=sinowel,dc=com
# The distinguished name to bind to the server with.
# Optional: default is to bind anonymously.
#binddn cn=proxyuser,dc=example,dc=com
binddn cn=admin,dc=sinowel,dc=com
# The credentials to bind with.
# Optional: default is no credential.
#bindpw secret
bindpw secret
# Filter to AND with uid=%s
#pam_filter objectclass=account
pam_filter objectclass=*
# The user ID attribute (defaults to uid)
#pam_login_attribute uid
pam_login_attribute uid
# Do not hash the password at all; presume
# the directory server will do it, if
# necessary. This is the default.
pam_password clear
二、SS5使用PAM+OpenLDAP的配置
##/etc/pam.d/ss5 配置文件
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
#
# Authentication using ldap
auth required /lib64/security/pam_ldap.so
##/etc/opt/ss5/ss5.conf 配置文件
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
set SS5_CONSOLE
set SS5_PAM_AUTH
set SS5_AUTHCACHEAGE 600
# ///////////////////////////////////////////////////////////////////////////////////
# SHost SPort Authentication
#
#auth 0.0.0.0/0 - -
auth 0.0.0.0/0 - u
# /////////////////////////////////////////////////////////////////////////////////////////////////
# Auth SHost SPort DHost DPort Fixup Group Band ExpDate
#
#permit - 0.0.0.0/0 - 0.0.0.0/0 - - - - -
permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
通过以上配置,SS5 Socks5代理使用PAM+OpenLDAP认证测试通过。
三、Squid使用PAM+OpenLDAP的配置
##/etc/pam.d/squid 配置文件
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
auth required /lib64/security/pam_ldap.so
account required /lib64/security/pam_ldap.so
##/usr/etc/squid.conf 配置文件
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#pam auth
auth_param basic program /usr/lib64/squid/pam_auth
auth_param basic children 5
auth_param basic realm Web-Proxy
auth_param basic credentialsttl 10 minute
auth_param basic casesensitive off
#acl config
acl pam_auth proxy_auth REQUIRED
#http access
http_access allow pam_auth
http_access allow localhost
注:以上,是对相关配置文件与PAM和OpenLDAP有关部分修改的说明,完整的配置文件不在此说明,可以参考网络或我其它文章的说明。
- Socks5和HTTP代理实现PAM+OpenLDAP用户认证
- 使用 PAM 集成 OpenLDAP 实现 Linux 统一管理系统用户
- 使用OpenLDAP实现集中用户认证
- socks5 转 http 代理
- openldap用户认证
- nginx+pam+mysql实现基于数据库的用户认证
- nginx+pam+mysql实现基于数据库的用户认证
- vsftp虚拟用户pam认证文件的创建和配置
- socks5反向代理实现思路
- Linux 用户认证---PAM验证机制
- 使用socks4 socks5 http代理的客户端
- 代理原理-http,socks5,ssl, shadowsocks
- FTP服务器工作原理及如何通过PAM认证实现虚拟用户登录
- java实现一个socks5代理 <一>了解socks5协议
- Socks5代理Socks5 Proxy
- PAM LDAP在Linux Redhat 5和Solaris 10系统上的用户认证
- nginx用户认证配置( Basic HTTP authentication)及认证原理和实现
- PAM认证
- curl常用命令
- C#开发-FTP操作方法整理 2--C# FTP操作类
- 史上最全最详细的Spring定时任务的讲解以及实例
- 七牛上传文件
- ipaynow现在支付——代付款
- Socks5和HTTP代理实现PAM+OpenLDAP用户认证
- Web前端相关资源
- Objective-C中NSString的使用
- NTFS USN的Create和工具代码汇总
- make -jN
- 准确率、精准率和召回率的理解
- Ques1017勇者斗恶龙
- android开发-Fragment生命周期
- 国庆中秋除了发月饼,企业更应该做什么?