Thursday, 28 August 2014

How To Install Squid Proxy on CentOS 6

How To Install Squid Proxy on CentOS 6

Step 1 - Spin up a CentOS 6.3 x64 droplet

Step 2 - Install Squid

yum -y install squid
chkconfig squid on

Step 3 - Setup Access Restrictions

Since this Squid proxy would allow anyone using it to make connections from your droplet's IP address, you would want to restrict access to it.
You can register a free dynamic IP from services like noip.com
If you would like to use this Squid proxy from your phone, you would have to install a dynamic DNS update client.
You can use applications like Dynamic DNS Client for Android, or FreeDynPro for iOS.
Once you have a dynamic IP hostname, you can update it from your router at home, mobile device, or an API call.
This hostname should be added to /etc/squid/squid.conf. Edit the file and add your hostname (nyproxy1.no-ip.org in our case):
acl localnet src nyproxy1.no-ip.org
Setup a crontab that reloads Squid every hour, in case your IP address changes:
echo 0 */1 * * * service squid reload >> /var/spool/cron/root

Step 4 - Configure Squid Proxy

By default, Squid listens on port 3128. If you would like to use a different port, modify/etc/squid/squid.conf
http_port 3128
If you would like to browse through this Squid proxy and not have it detected as a proxy, setup anonymous settings by adding these lines to /etc/squid/squid.conf:
via off
forwarded_for off

request_header_access Allow allow all 
request_header_access Authorization allow all 
request_header_access WWW-Authenticate allow all 
request_header_access Proxy-Authorization allow all 
request_header_access Proxy-Authenticate allow all 
request_header_access Cache-Control allow all 
request_header_access Content-Encoding allow all 
request_header_access Content-Length allow all 
request_header_access Content-Type allow all 
request_header_access Date allow all 
request_header_access Expires allow all 
request_header_access Host allow all 
request_header_access If-Modified-Since allow all 
request_header_access Last-Modified allow all 
request_header_access Location allow all 
request_header_access Pragma allow all 
request_header_access Accept allow all 
request_header_access Accept-Charset allow all 
request_header_access Accept-Encoding allow all 
request_header_access Accept-Language allow all 
request_header_access Content-Language allow all 
request_header_access Mime-Version allow all 
request_header_access Retry-After allow all 
request_header_access Title allow all 
request_header_access Connection allow all 
request_header_access Proxy-Connection allow all 
request_header_access User-Agent allow all 
request_header_access Cookie allow all 
request_header_access All deny all

Step 5 - Start Squid proxy service

service squid start

Step 6 - Modify your browser's proxy settings

Add your droplet's IP address and port to your browser's proxy settings.

Step 7 - Verify Squid proxy works

Navigate over to whatismyip.com
And you are all done!

Friday, 22 August 2014

Centos Install and Configure MRTG

Centos Install and Configure MRTG

by  on JULY 30, 2009 · 20 COMMENTS· LAST UPDATED MARCH 18, 2011

How do I install and configure MRTG under Fedora Linux or CentOS Linux v5.x server to monitor the traffic load on network-links including routers?

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links.
MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic. You need the following packages:
  • mrtg : Multi Router Traffic Grapher
  • net-snmp and net-snmp-utils : SNMP (Simple Network Management Protocol) is a protocol used for network management. The NET-SNMP project includes various SNMP tools. net-snmp package contains the snmpd and snmptrapd daemons, documentation, etc. You also want to install the net-snmp-utils package, which contains NET-SNMP utilities.
This FAQ works with RHEL / CentOS and Fedora Linux.

Step # 1: Install MRTG

Type the following command to install packages using yum command under CentOS / Fedora Linux:
# yum install mrtg net-snmp net-snmp-utils

Step # 2: Configure snmpd

If you need to monitor localhost including interface and other stuff such as CPU, memory etc, configure snmpd. Open /etc/snmp/snmpd.conf, enter:
# vi /etc/snmp/snmpd.conf
Update it as follows to only allow access from localhost:
com2sec local     localhost           public
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
view all    included  .1                               80
access MyRWGroup ""      any       noauth    exact  all    all    none
syslocation VSNL, India
syscontact Root <vivek@nixcraft.tld>
Save and close the file. Restart snmpd:
# chkconfig snmpd on
# service snmpd restart

Make sure you see interface IP, by running the following command:
# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
Sample Outputs:
IP-MIB::ipAdEntIfIndex.123.xx.yy.zzz = INTEGER: 2
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1

Step # 3: Configure MRTG

Use cfgmaker command to creates /etc/mrtg/mrtg.cfg file, enter:
# cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@localhost
  • --global 'WorkDir: /var/www/mrtg' : add global config entries i.e. set workdir to store MRTG graphs.
  • --output /etc/mrtg/mrtg.cfg: configr output filename
  • public@localhost : public is the community name of the device you want to create a configuration for. If you are using the wrong community name you will get no response from the device. localhost is the DNS name or the IP number of an SNMP-managable device i.e. our local server.
Finally, run indexmaker to create web pages which display the status of an array of mrtg interface status pages:
# indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg

Step # 4: Verify Cron Job

/etc/cron.d/mrtg runs mrtg command to monitor the traffic load on network links:
# cat /etc/cron.d/mrtg
Sample Output:
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
Just make sure crond is running and you are done with configuration:
# chkconfig --list crond
If it is off in run level # 3, just run the following to turn on crond service:
# chkconfig crond on
# service crond on

How do I view mrtg graphs?

You need Apache web server to view graphs, simply type the following to install httpd:
# yum install httpd
# chkconfig httpd on
# service httpd on

Fire a webbrowser and type the url:
http://your-ip.add.ress/mrtg/
http://192.168.1.5/mrtg/
Fig.01:Sample MRTG Graph
Fig.01:Sample MRTG Graph

How Do I Create MRTG For My Router at 192.168.1.254?

Run cfgmaker as follows (there is no need to configure snmp for router, as most router and switches comes pre configured with their own SNMPD):
# cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@router
OR
# cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@192.168.1.254

Thursday, 21 August 2014

Linux Configure Firewall Using Shorewall Under RHEL / CentOS

Linux Configure Firewall Using Shorewall Under RHEL / CentOS

by  on DECEMBER 19, 2012 · 3 COMMENTS· LAST UPDATED DECEMBER 20, 2012

Aproperly configured firewall can greatly increase the security of RHEL / CentOS based system. How do I configure a shorewall based firewall for CentOS or Red Hat Enterprise Linux system with an Internet connection? How do I install and configure shorewall to protect the following small business network?

The Shoreline Firewall (also known as "Shorewall"), is a Netfilter (iptables) based firewall that can be used on a dedicated firewall system, a multi-function gateway/ router/server or on a standalone GNU/Linux system.

What is Shorewall?

Usually, you write a complicated set of firewall rules using /etc/sysconfig/iptables or shell scripts. However, with shorewall you describe your firewall/gateway requirements using entries in a set of configuration files. Shorewall reads those configuration files and with the help of the iptables, iptables-restore, ip and tc utilities, Shorewall configures Netfilter and the Linux networking subsystem to match your requirements. Shorewall is not a simple and easy to use GUI tool.

Sample setup

Fig.01: CentOS+Shorewall
Fig.01: CentOS+Shorewall

Where,
  1. server1.cyberciti.biz (firewall) - CentOS / RHEL based server. You need to install shorewall on this system. This server has two network interfaces. eth0 is connected to the LAN, and eth1 is connected to the internet. You also need to install reverse proxy server such as lighttpd or nginx on this server so it can load balance traffic between three Apache backends.
  2. Apache{1..3} - Apache web servers.
  3. Mysqld - MySQL database server.
  4. The default firewall policy is to drop all traffic. Allow all connection requests from your lan network (eth0) to the Internet (eth1) and/or to the other servers hosted on the lan. Drop all connection requests from the Internet (eth1) to your firewall (fw) or lan networks; these ignored connection requests will be logged using the info syslog priority (log level). Finally, open port 80 and 443 from the the Internet. The firewall reject all other connection requests; these rejected connection requests will be logged using the info syslog priority (log level).

Install shorewall on CentOS or RHEL

First, turn on EPEL repo and type the following yum command to install shorewall package ( Debian / Ubuntu Linux user read this faq for more information ) :
# yum install shorewall
Sample outputs:
 
Loaded plugins: protectbase, rhnplugin
0 packages excluded due to repository protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package shorewall.noarch 0:4.5.4-1.el6 will be installed
--> Processing Dependency: shorewall-core = 4.5.4-1.el6 for package: shorewall-4.5.4-1.el6.noarch
--> Processing Dependency: perl(Digest::SHA) for package: shorewall-4.5.4-1.el6.noarch
--> Running transaction check
---> Package perl-Digest-SHA.x86_64 1:5.47-127.el6 will be installed
---> Package shorewall-core.noarch 0:4.5.4-1.el6 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
================================================================================
 Package            Arch      Version             Repository               Size
================================================================================
Installing:
 shorewall          noarch    4.5.4-1.el6         epel                    517 k
Installing for dependencies:
 perl-Digest-SHA    x86_64    1:5.47-127.el6      rhel-x86_64-server-6     62 k
 shorewall-core     noarch    4.5.4-1.el6         epel                     64 k
 
Transaction Summary
================================================================================
Install       3 Package(s)
 
Total download size: 643 k
Installed size: 2.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): perl-Digest-SHA-5.47-127.el6.x86_64.rpm           |  62 kB     00:00
(2/3): shorewall-4.5.4-1.el6.noarch.rpm                  | 517 kB     00:00
(3/3): shorewall-core-4.5.4-1.el6.noarch.rpm             |  64 kB     00:00
--------------------------------------------------------------------------------
Total                                           1.0 MB/s | 643 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:perl-Digest-SHA-5.47-127.el6.x86_64                        1/3
  Installing : shorewall-core-4.5.4-1.el6.noarch                            2/3
  Installing : shorewall-4.5.4-1.el6.noarch                                 3/3
  Verifying  : shorewall-4.5.4-1.el6.noarch                                 1/3
  Verifying  : shorewall-core-4.5.4-1.el6.noarch                            2/3
  Verifying  : 1:perl-Digest-SHA-5.47-127.el6.x86_64                        3/3
 
Installed:
  shorewall.noarch 0:4.5.4-1.el6
 
Dependency Installed:
  perl-Digest-SHA.x86_64 1:5.47-127.el6   shorewall-core.noarch 0:4.5.4-1.el6
 
Complete!
 

A note about config files

  1. The default configuration directory is located at /etc/shorewall/.
  2. Shorewall global configuration file is located at /etc/shorewall/shorewall.conf. This file sets options that apply to Shorewall as a whole.
  3. The /etc/shorewall/zones file declares your network zones. Rules about what traffic to allow and what traffic to deny are expressed in terms of zones.
  4. The /etc/shorewall/interfaces file serves to define the firewall's network interfaces to Shorewall.
  5. The /etc/shorewall/policy file defines the high-level policy for connections between zones defined in /etc/shorewall/zones.
  6. To provide exceptions to policies, add rules to /etc/shorewall/rules. Use this file to open or close ports and so on.
  7. To blacklist IPs, applications, MAC address, and subnets use the/etc/shorewall/blacklist file.

Rule status and ordering

The ordering of shorewall is very important as when a rule has been matched that action is performed and then no other action is performed.
  1. For each connection request entering the firewall, the request is first checked against the/etc/shorewall/rules file.
  2. If no rule in that file matches the connection request then the first policy in/etc/shorewall/policy that matches the request is applied.
  3. If there is a default action defined for the policy in /etc/shorewall/shorewall.confthen that action is invoked before the policy is enforced.

Configuration

Shorewall uses the concept of zones. You need to define the network using a set of zones as follows for the two network-interface configuration:
#NAME                  DESCRIPTION
fw                     The firewall itself
wan                    The Internet
lan                    Your Local Network

Configure /etc/shorewall/zones

Edit the file /etc/shorewall/zones, enter:
# vi /etc/shorewall/zones
Update the file as follows:
fw      firewall
wan     ipv4
lan     ipv4
Shorewall recognizes the firewall system as its own zone. The name of the zone designating the firewall itself (usually 'fw' as shown in the above file) is stored in the shell variable $FW which may be used throughout the Shorewall configuration to refer to the firewall zone. The wan and lan are our standard IPv4 Shorewall zone type and is the default if you leave this column empty.

Configure /etc/shorewall/interfaces

Next, you need define the hosts in a zone. You can associate the zone with a network interface using the /etc/shorewall/interfaces file. In the two-interface sample, the two zones are defined using that file as follows. Edit the file /etc/shorewall/interfaces, enter:
# vi /etc/shorewall/interfaces
Append the following entires:
 
wan     eth1    -       routefilter,blacklist,tcpflags,logmartians,nosmurfs
lan     eth0
 
The above file defines the net zone as all IPv4 hosts interfacing to the firewall. The wan zone as all IPv4 hosts interfacing through eth1 and the lan as all IPv4 hosts interfacing through eth0. The wan interface eth1 has additional advanced protection from the common internet attacks:
  1. routefilter - Turn on kernel route filtering for this interface i.e. turn on anti-spoofing measurements.
  2. blacklist - Check packets arriving on this interface against the /etc/shorewall/blacklist file. The blacklist file is used to perform static blacklisting. You can blacklist by source address (IP or MAC), or by application.
  3. tcpflags - Packets arriving on this interface are checked for certain illegal combinations of TCP flags such as x mas or null or invalid packets. Packets found to have such a combination of flags are dropped (see the settings of TCP_FLAGS_DISPOSITION option in shorewall.conf) after having been logged in /var/log/messages file (see the setting ofTCP_FLAGS_LOG_LEVEL in shorewall.conf).
  4. logmartians - Turn on kernel martian logging (logging of packets with impossible source addresses). It is strongly suggested that if you set routefilter on an interface that you also set logmartians.
  5. nosmurfs - Filter packets for smurfs (packets with a broadcast address as the source) i.e. turn on anti-smurf protection.

Configure /etc/shorewall/policy

You express your default policy for connections from one zone to another zone in the/etc/shorewall/policy. file. The basic choices for policy are:
  1. ACCEPT - Accept the connection.
  2. DROP - Ignore the connection request.
  3. REJECT - Return an appropriate error to the connection request.
  4. Connection request logging may be specified as part of a policy and it is conventional (and highly recommended) to log DROP and REJECT policies.
Edit the file /etc/shorewall/policy, enter:
# vi /etc/shorewall/policy
Append the policy:
## allow lan to all and firewall to all (outgoing to internet) but no traffic from wan/internet to lan or firewall itself
lan     all     ACCEPT
$FW     all     ACCEPT
wan     all     DROP    info
# this must be last rule
all     all     REJECT  info
Save and close the file.

Configure /etc/shorewall/rules

Entries in this file govern connection establishment by defining exceptions to the policies layed out in /etc/shorewall/policy file. Use this file to open or close TCP/UDP ports. You can allows access to applications server such as FTP, HTTP, HTTPS and many more as defined in /usr/share/shorewall/macro.* files. The syntax is as follows:
ACTION SOURCE  DEST    PROTO   DEST    SOURCE  RATE    USER/
                               PORT(S) PORT(S) LIMIT   GROUP
OR
ACTION    SOURCE        DEST      PROTO      DEST
                                             PORT(S)
For example, to open port 22 from wan (internet) to firewall, enter:
ACCEPT     wan           $FW       tcp        22
You have a policy of ignoring all connection attempts from the wan zone (from the Internet), the above exception to that policy allows you to connect to the SSH server running on your firewall. You can now open port 80 and 443 that allows to connect to the reverse proxy server running on firewall:
## open port 443 from the wan to the nginx running on 202.54.1.1:443 on your firewall.
HTTPS/ACCEPT    wan     $FW:202.54.1.1              -       443
## open port 80 from the wan to the nginx running on 202.54.1.1:80 and 202.54.1.2:80 on your firewall.
HTTP/ACCEPT     wan     $FW:202.54.1.1,202.54.1.2   -       80
The wan / internet interface should not receive any packets whose source is in one of the ranges reserved by RFC 1918 (i.e., private or "non-routable" addresses). If packet mangling or connection-tracking match is enabled in your kernel, packets whose destination addresses are reserved by RFC 1918 are also rejected. Add the following DROP rule:
Rfc1918/DROP    wan     $FW
The following exception allows you to ping your firewall from the wan/internet:
Ping/ACCEPT     wan     $FW
Save and close the file. Please note that both Ping and Rfc1918 are macros defined in/usr/share/shorewall/macro.Ping file. To view ping macro type:
# cat /usr/share/shorewall/macro.Ping
Sample outputs:
# Shorewall version 4 - Ping Macro
#
# /usr/share/shorewall/macro.Ping
#
#       This macro handles 'ping' requests.
#
###############################################################################
#ACTION SOURCE  DEST    PROTO   DEST    SOURCE  RATE    USER/
#                               PORT(S) PORT(S) LIMIT   GROUP
PARAM   -       -       icmp    8
To see list of all supported macros, enter:
# ls /usr/share/shorewall/macro.*
Sample outputs:
Fig.02: Macro list (click to enlarge)
Fig.02: Macro list (click to enlarge)

Configure /etc/shorewall/blacklist

Edit the file /etc/shorewall/blacklist, enter:
# vi /etc/shorewall/blacklist
Block 202.53.1.0/24 subnet and 190.1.2.3 IP address:
202.53.1.0/24
190.1.2.3
Save and close the file.

Check the firewall configuration for errors

Type the following command:
# vi /etc/shorewall/shorewall.conf
Find the line:
STARTUP_ENABLED=No
Replace with:
STARTUP_ENABLED=Yes
Save and close the file. Shorewall uses a "compile" then "execute" approach. The Shorewall configuration compiler reads the configuration files and generates a shell script. Errors in the compilation step cause the script to be discarded and the command to be aborted. If the compilation step doesn't find any errors then the shell script is executed. To check for errors, enter:
# shorewall check
Sample outputs:
Fig.03: Checking firewall configuration for error
Fig.03: Checking firewall configuration for error

Save existing firewall rules

Use iptables-save command to dump the contents of an IP Table in easily parseable format to screen or a file:
# iptables-save > /root/old.firewall.config
However, I recommend that you use the following commands to save and disable iptables service on CentOS/RHEL:
# service iptables save
# service iptables stop
# chkconfig iptables off

How do I start / stop / restart shorewall?

Type the following commands (warning poorly configured firewall rules may block out your remote access including ssh, so be careful when you type the following commands):
# service shorewall start
# service shorewall stop
# service shorewall restart
# service shorewall status

OR
# /etc/init.d/shorewall start
# /etc/init.d/shorewall stop
# /etc/init.d/shorewall restart
# /etc/init.d/shorewall status

To turn on shorewall at boot time, enter:
# chkconfig shorewall on

How do I list firewall rules?

Type the following command:
# shorewall show
# shorewall show | less

How do I see the IP connections currently being tracked by the firewall?

# shorewall show connections

How do I see firewall logs?

# shorewall show hits
# shorewall show hits|less

How do I displays my kernel/iptables capabilities?

# shorewall show capabilities
The shorewall command and firewall configurations allows many more options. I recommend that you read shorewall command man page for more information.

How do I list all macros?

# shorewall show macros
# shorewall show Web

Sample outputs:
Shorewall 4.5.4 Macro Web at server1.cyberciti.biz - Thu Dec 20 03:50:27 CST 2012
#
# Shorewall version 4 - Web Macro
#
# /usr/share/shorewall/macro.Web
#
# This macro handles WWW traffic (secure and insecure).  This
# macro is deprecated - use of macro.HTTP and macro.HTTPS instead
# is recommended.
#
###############################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
#    PORT(S) PORT(S) LIMIT GROUP
PARAM - - tcp 80 # HTTP (plaintext)
PARAM - - tcp 443 # HTTPS (over SSL)

Friday, 15 August 2014

Rsync module setup

Rsync 安装配置

安装
# yum list rsync   #检查check if exist
# yum install rsync   #installing by yum


服务端配置Server side configuration
  1. Motto Of The Day 文件
    #mkdir /etc/rsyncd      #to create folder to organise  创建文件夹方便组织
    # vi /etc/rsyncd/rsyncd.motd       #to create the motd file,like below:
    Welcome to RsyncServer xxxx
  2. 密码认证文件security  authentication file , the name is not fixed.
    # vi /etc/rsyncd/rsyncd.sec_xxx (文件名随意)
    user1:password1
    user2:password2
    # chmod 600 rsyncd.sec_xxx
  3. 编辑配置文件edit the configure file
    # vi rsyncd.conf  (example:)

  1. 启动start
    1. 独立模式 daemon mode
      #rsync --daemon
      # ps aux|grep rsync  或 # netstat -nlp | grep 873  检查是否启动
      # kill $(cat /var/run/rsyncd.pid)         关闭
    2. xinetd mode
      1. # yum list installed |grep xinetd    ##check if xinetd exist, if not , then install it
        #yum install xinetd
      2. 配置Configure rsync as xinetd based service
        # vi /etc/xinetd.d/rsync
           disable     = yes  改为 no
      3. 启动服务,检查端口
        # service xinetd restart
        # netstat -nlp | grep 873

        #chkconfig --list |grep xinetd   检查xinetd服务是否自启动,若无则
        #chkconfig xinetd on
        #service xinetd start/stop          启动、停止xinetd



客户端Client
  • rsync -avrPz --exclude-from=/    [username]@[rsync-server_ip]::[模块名]/[子路径]/   [Dest] --password-file=  | grep -v '/$'
note:保险期间,源和目的路径以/结尾


附1:cwRsync相关
windows平台上的为csRsync, 基本一样,注意的是win下路径中的盘符。如:

附2:参数说明
  • -a option to make an archive of the source.  Following items enumerate details of its equivalent -rlptgoD (no -H, -A, -X)

  1. -r : recurse into directories
  2. -l : copy symlinks as symlinks
  3. -p : preserve permissions
  4. -t : preserve modification times
  5. -g : preserve group
  6. -o : preserve owner
  7. -D : preserve device and special files
  8. no -H : does not preserve hard links
  9. no -A : does not preserve ACLs
 10. no -X : does not preserve extended attributes
  • -n,
    测试,--dry-run option to perform trial run with no changes
  • --delete
删除源不存在而目的地存在的文件
  • exclude
    • 客户端脚本中:
      --exclude=PATTERN
      --exclude-from=FILE  从文档中读取排除文件
      排除文档中文件列表格式(一行一个文件或目录):
      - /aaa/bbb/**
      - /aaa/ccc/ff            这里的根/相对于模块中定义的路径,而非系统/目录
    • 服务端:
      exclude from =
  • --password-file=
    客户端脚本中密码文件指定


附3.参考脚本
  • 测试机从临时目录到正式目录同步
#cat test_sync_xxx.web_from_tmp.sh   (测试脚本)
/usr/bin/rsync -varltcn --delete --exclude-from=/bak/Sync/XXX/web.exclude /www_tmp/XXX/web/  /www/XXX/web/ |grep -v '/$'
/bin/echo -e "\n\n"
/bin/echo "Excluded Files:"
/bin/cat /bak/tongbu/【】/web.exclude |grep -E -i '(^-|^[a-z]|^[A-Z])'
/bin/echo -e "\n"

note:正式脚本命名去掉test即可,脚本中去掉-n参数

  • 运营服务器上从测试机同步
  • rsync.com example:
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsync.lock
use chroot=yes
max connections=10
motd file=/etc/rsyncd/rsyncd.motd
log file=/var/log/rsync.log
transfer logging=yes
timeout=300
uid=root
gid=root

[upload_w]
path=/web_tmp/xxx/
list=yes
read only=no
ignore errors
auth users=testup_w
secrets file=/etc/rsyncd/rsyncd.sec
#hosts allow=10.8.0.1/24,180.214.166.196/29
#hosts deny=*
#incoming chmod=u+rwx,go+rx
uid=
gid=

[deploy_r]
path=/web/xxx/
list=yes
read only=yes
ignore errors
auth users=testdep_r
secrets file=/etc/rsyncd/rsyncd.sec
#hosts allow=
#hosts deny=*
#outgoing chmod=u+rwx,go+rx
#uid=
#gid=