Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7446217
  • 博文数量: 1758
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16252
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1758)

文章存档

2024年(4)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2009-12-03 12:34:55

1. 安装SS5:
# tar -zxvf ss5-3.6.4-3.tar.gz
# cd ss5-3.6.4-3
# ./configure
# make
# make install
# cp conf/ss5.conf conf/ss5.passwd /etc/opt/ss5/
# vi /etc/init.d/ss5
原启动教本有误,请修改第34行的“if”为“elif”。
2. 配置SS5:
# vi /etc/opt/ss5/ss5.conf
============+============+============
#实现用户认证并限制带宽:
set SS5_DNSORDER
set SS5_PAM_AUTH
auth 0.0.0.0/0 - u
permit - 0.0.0.0/0 - 0.0.0.0/0    -     -       -       10240   -
#如果要实现不同用户认证并分别限制带宽,在/etc/opt/ss5目录创建user和file两个文件,该文件中含有要认证的用户名:
permit  - 0.0.0.0/0  -  0.0.0.0/0   -       -       user    10240   -
permit  - 0.0.0.0/0  -  0.0.0.0/0   -       -       file    102400   -
============+============+============
3. 配置PAM认证:
# vi /etc/pam.d/ss5
============+============+============
auth       optional     /usr/lib/security/pam_mysql.so user=ss5 \
passwd=121212 host=localhost db=ss5 table=user \
usercolumn=username passwdcolumn=passwd crypt=2
account    required     /usr/lib/security/pam_mysql.so user=ss5 \
passwd=121212 host=localhost db=ss5 table=user \
usercolumn=username passwdcolumn=passwd crypt=2
============+============+============
4. 安装PAM_MYSQL:
# tar -zxvf pam_mysql-0.7RC1.tar.gz
# cd pam_mysql-0.7RC1
# ./configure --with-openssl --with-mysql=/usr/local/mysql
# make
# make install
# echo "/usr/lib/security" >> /etc/ld.so.conf
# ldconfig
5. 创建数据库:
# mysqladmin -u root -pmysqldbserver create ss5
# mysql -u root -pmysqldbserver
mysql> use ss5;
mysql> GRANT ALL PRIVILEGES ON ss5.* TO IDENTIFIED BY '121212';
mysql> CREATE TABLE user (ID int not null auto_increment,USERNAME varchar(64), PASSWD varchar(255), primary key(ID) );
6. 添加测试用户:
mysql> insert into user (username,passwd) values ('test',password('1234'));
 
 
7. 附录:
Example 3, a case study
In the following case, ss5 works with:
1. PAM authentication using pam_winbind.so
2. Directory authorization with multiple userstore (Active Directory)
3. Authentication cache enable
4. Authorization cache enable
5. Netbios domain support
6. Proxy upstream through other socks server
7. Traffic dump to file
auth 0.0.0.0/0 - u
# Enable PAM authentication
set SS5_PAM_AUTH
# Set session timeout
set SS5_STIMEOUT 3600
# Enable Cache for authentication for 600 seconds
# set SS5_AUTHCACHEAGE 600
# Enable Cache for authorization for 600 seconds
# set SS5_AUTHOCACHEAGE 600
# Enable directory authorization with filter mode
set SS5_LDAP_FILTER
# Enable netbios domain mapping with directory
( socks username in the form: domainA\user1 )
set SS5_NETBIOS_DOMAIN
# Dump traffic data to file for connections through an Oracle db server
dump 182.10.10.20/32 1521 1
# Upstream proxy for 162.10.10.0 network
proxy 162.10.10.0/24 - 10.10.10.20 1080 -
# Permit http access to user who belong to WEB group into Active Directory
#Auth SHost SPort DHost DPort Fixup Group Band
permit u 0.0.0.0/0 - 182.10.0.0/16 80 - CN=WEB,CN=Users,DC=subDomainA,DC=DomainA,DC=it -
permit u 0.0.0.0/0 - 182.10.0.0/16 80 - CN=WEB,CN=Users,DC=subDomainB,DC=DomainB,DC=it -
# Netbios domain (in case of MSdomainA\userA)
ldap_profile_ip 162.10.20.1
ldap_profile_port 389
ldap_profile_base DC=subDomainA,DC=DomainA,DC=it
ldap_profile_filter cn
ldap_profile_attribute MemberOf
ldap_profile_dn CN=userReader,cn=Users,DC=subDomainA,DC=DomainA,DC=it
ldap_profile_pass password
ldap_netbios_domain MSDomainA
# Netbios domain (in case of MSdomainB\userB)
ldap_profile_ip 162.10.30.1
ldap_profile_port 389
ldap_profile_base DC=subDomainB,DC=DomainB,DC=it
ldap_profile_filter cn
ldap_profile_attribute MemberOf
ldap_profile_dn CN=userReader,cn=Users,DC=subDomainB,DC=DomainB,DC=it
ldap_profile_pass password
ldap_netbios_domain MSdomainB
使用密码文件认证:
# vi /etc/opt/ss5/ss5.passwd
test  123456
llzqq  123456
阅读(1714) | 评论(3) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-11-14 06:03:27

请问如何实现限制用户连接数呢?
比如同一个账号只能有3个链接

badb0y2009-12-12 20:01:38

SS5是一个socks5的代理服务器! 流水账是一种步骤,,方便初学者,,一看就懂呀,和和

chinaunix网友2009-12-09 13:46:42

楼主每次写文章都是流水账吗? SS5是干嘛的。希望多加文字说明。感谢