Hacked By KID2ZON3

Anonymous Cyber Team

Hacked By KID2ZON3



Hacked By KID2ZON3

[ Official ]
| 4wsec | Mr.G3N203Tz | BlackList_Cyber | Tn.F100X | Mr.TenWap | Tn.F100X | w4rlo0k | Mr.NightRaven | Number4 | Ms Kacau | CYBERSCRYTECH_ | Mr.MinZ | | Bl4ck5w012d | Stut_Jack | Mr_"S" | FronS | ./Rx-D5N | L0C4LSH1T | KATENBAD | MR.200(OK)|

[ Special Thanks ]
| KATENBAD | L0C4LSH1T | ./Rx-D5N |

[ Thanks To ]
[ Hacker Patah Hati ] [ IndoXploit ] [ Traffic Cyber Team ] [ N45HT ] [ All Member Anonymous Cyber Team ]


All Categories


Pages

Inotify + Rsync Directory Real-time Synchronization

Two Linux server systems CentOS7

A Apache IP: 192.168.155.130 (release file server, can also be called rsync client)

A nginx IP: 192.168.155.131 (synchronous image file server, can also be called rsync server)

The Apache server synchronizes the folder path

/ usr / local / apache / htdocs

The nginx server synchronizes the folder path

/ usr / local / nginx / html

nginx server

rsync

Download https://rsync.samba.org/

wget download path https://download.samba.org/pub/rsync/src/rsync-3.1.2.tar.gz

What is used here

rsync-3.1.2.tar.gz

WinSCP upload to the specified directory, here is

/ usr / local / src

shell end

Go to the installation package directory

cd / usr / local / src

Unzip rsync to the current folder, where the decompression can not add z parameters

tar -xvf rsync-3.1.2.tar.gz

Go to the decompression directory

cd rsync-3.1.2

Configure the installation directory

http://www.cnblogs.com/dreamhome/p/configure --prefix = / usr / local / rsync

Compile

make

installation

make install

After installing the rsyncd configuration file is stored in /etc/rsyncd.conf

Edit delete the original content into the following, uid parameter to the timeout parameter part of the global parameters, [rsyncserver] start and later part of the module parameters

uid = root

gid = root

port = 873

max connections = 0

motd file = / usr / local / rsync / rsyncd.motd

log file = / usr / local / rsync / rsyncd.log

pid file = / usr / local / rsync / rsyncd.pid

lock file = / usr / local / rsync / rsyncd.lock

address = 192.168.155.131

transfer logging = true

log format =% t% a% m% f% b

timeout = 900

hosts allow = 192.168.155.130 192.168.155.129

hosts deny = *

syslog facility = local3

dont compress = *. gz * .tgz * .zip * .z * .Z * .rpm * .deb * .bz2

[rsyncserver]

path = / usr / local / nginx / html /

exclude = lost / found /

comment = rsync from 192.168.155.130

ignore errors

read only = false

list = true

use chroot = false

auth users = rsyncuser

secrets file = / usr / local / rsync / rsyncd.secrets

esc +: wq save

vim /etc/rsyncd.conf

New rsync user name, password file Enter the following, user name and password with: separate, one line of a user, where only one user

rsyncuser: 123456

vim /usr/local/rsync/rsyncd.secrets

Setting permissions

Because rsyncd.secrets stores the username and password for the rsync service, it is important. To set rsyncd.secrets to root, the permissions are 600

chmod 600 /usr/local/rsync/rsyncd.secrets

Start the rsync service

The value of the rsync global parameter can also be set when performing rsync, for example

- daemon: Starts a daemon to execute rsync

--address: and --port role reference global rsync configuration file global parameter information, these two parameters can be added without

--config: specify the location of the configuration file, not the default is /etc/rsyncd.conf

/ usr / local / rsync / bin / rsync --daemon --address = 192.168.155.131 --port = 873 - config = / etc / rsyncd.conf

Check if the rsync port has a corresponding service

lsof -i: 873

Open external access to firewall 873 port

firewall-cmd --zone = public --add-port = 873 / tcp --permanent

Restart the firewall

firewall-cmd --reload

Apache server

rsync

The rsync and nginx servers used here are the same

rsync-3.1.2.tar.gz

inotify-tools

Download http://inotify-tools.sourceforge.net/

wget download path https://cloud.github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz

What is used here

inotify-tools-3.14.tar.gz

WinSCP upload to the specified directory, here is

/ usr / local / src

shell end

Go to the installation package directory

cd / usr / local / src

Unzip rsync to the current folder, where the decompression can not add z parameters

tar -xvf rsync-3.1.2.tar.gz

Go to the decompression directory

cd rsync-3.1.2

Configure the installation directory

http://www.cnblogs.com/dreamhome/p/configure --prefix = / usr / local / rsync

Compile

make

installation

make install

Create a server-side password file, you only need to enter the server-side password, do not enter the user name

Fill in the above server-side password file set the password, the user name specified in the command line

123456

vim /usr/local/rsync/rsyncd.pass

Set permissions, and can only be set to 600

chmod 600 /usr/local/rsync/rsyncd.pass

Upload the synchronization file to the server

/ usr / local / apache / htdocs / The local client wants to synchronize the folder

The rsyncuser server-side rsync service sets the user name that allows the module to be executed

192.168.155.131 server-side IP address

:: rsyncserver represents the module name that the server needs to synchronize

Command line arguments

-v: verbose

-z: compression

-r: recursive

-t: Indicates that the original file creation time is maintained

-o: that keep the original file owner

-p: Indicates the parameters that keep the original file

-g: Indicates that the original file belongs to the group

-a: archive mode

-P: Indicates the option to replace both -partial and -progress

-e: ssh builds an encrypted connection.

- divial: prevents rsync from deleting the copied portion when the transfer is interrupted (if the transfer is interrupted while the file is being copied, the default operation of rsync is the pre-undo operation, ie, the copied part of the file is deleted from the target machine.)

--progress: refers to show the details of the progress of the situation

--delete: delete the client, the server is also deleted, to maintain a real consistency.

--exclude: does not include the / ins directory

--size-only: This parameter is used in the difference between the two folders only the source folder there are some new files, there is no re-name and modified files, because this file may be because the content is modified Can be the same size, but was omitted. This parameter can greatly improve the efficiency of synchronization, because it does not need to check the contents of the same name file is the same.

--password-file: Specifies the password file that contains the server-side authentication user. If you do not add this option to the server, you will be prompted to enter the password manually.

/ usr / local / rsync / bin / rsync -vzrtopg --delete --progress --password-file = / usr / local / rsync / rsyncd.pass / usr / local / apache / htdocs / rsyncuser@192.168.155.131 :: rsyncserver

Before installing inotify need to install gcc and gcc-c ++

yum install-y gcc gcc-c ++

cd / usr / local / src

tar -zxvf inotify-tools-3.14.tar.gz

cd inotify-tools-3.14

http://www.cnblogs.com/dreamhome/p/configure --prefix = / usr / local / inotify

Compile

make

installation

make install

Write the script to execute inotify Fill in the following to enable inotify to monitor the specified directory in real time and do the appropriate action

#! / bin / bash

# Synchronous receiver ip

client = 192.168.155.131

# Local to monitor the folder path

local_folder = / usr / local / apache / htdocs /

# Synchronize the rsync module name configured by the receiver

module = rsyncserver

# Synchronize the user when the receiver is authenticated

user = rsyncuser

/ usr / local / inotify / bin / inotifywait -mrq --timefmt '% d /% m /% y% H:% M' --format '% T% w% f% e' -e create, move, delete , modify, attrib $ local_folder | while read files

do

/ usr / local / rsync / bin / rsync -vzrtopg --delete --progress --password-file = / usr / local / rsync / rsyncd.pass $ local_folder $ user @ $ client :: $ module

done

inotify part of the parameter

-m is kept listening

-r is recursively viewing the directory

-q is to print out the event

-e create, move, delete, modify, attrib refers to the listener u0026 ldquo; create mobile delete modify the property u0026 rdquo; event

vim /usr/local/inotify/inotify.sh

Set script permissions

chmod 755 /usr/local/inotify/inotify.sh

The background execution script starts listening and synchronizing

/usr/local/inotify/inotify.shu0026

Will sh /usr/local/inotify/inotify.sh u0026 this code written in the /etc/rc.d/rc.local file on the last line, so that the implementation of the background /usr/local/inotify/inotify.sh script

nginx server-side rsync also use this method to write the script and then added to the boot

echo '/usr/local/inotify/inotify.sh u0026' u0026 gt; u0026 gt; /etc/rc.d/rc.local

appendix

uid = root # The user who ran the rsync daemon

gid = root # The group that ran the rsync daemon

port = 873 # default port 873

max connections = 0 # The maximum number of connections is unlimited. Specify the maximum number of concurrent connections for the module to protect the server. If the connection request exceeds the limit, it will be told that it will be retried.

motd file = / usr / local / rsync / rsyncd.motd # used to specify a message file, when the client connected to the server when the contents of the file displayed to the customer, the default is no motd file.

log file = / usr / local / rsync / rsyncd.log # Specify the log file location where the rsync daemon is running without sending the log to syslog.

pid file = / usr / local / rsync / rsyncd.pid # The daemon writes its PID to the file's storage location

lock file = / usr / local / rsync / rsyncd.lock # Specifies the lock file storage location that supports the max connections parameter.

address = 192.168.155.131 # When running independently, bind this service to the specified IP address (here is the native IP address). This parameter is ignored by the xinetd runtime, using the --address option on the command line.

transfer logging = true # Causes the rsync server to record the transfer operation to the transport log file.

This option allows the user to customize the fields of the log file by using transfer logging. Its format is a string containing the format definition, you can use the format definition as follows:

timeout = 900 # unit seconds, this option can override the customer specified IP timeout. Thus ensuring that the rsync server does not always wait for a crashing client.

hosts allow = 192.168.155.130 192.168.155.129 # Run the rsync server to access the IP address, or network segment, or use * to allow all, multi-IP space separation

hosts deny = * # does not allow access to the rsync server IP address, assignment rules with hosts allow

syslog facility = local3 # Specifies the message level when rsync sends log messages to syslog. The common message levels are: uth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, sys-log, user, uucp local0, local1, local2, local3, local4, local5, local6, and local7. The default is daemon.

db compress * * .deb * .bz2 # is used to specify those files that are not compressed before they are transmitted.

[rsyncserver] # here is the authentication module name, in the client (here is the Apache server) need to specify the end

path = / usr / real-time backup utility local / nginx / html / # need to do the mirror directory

exclude = lost / found / # does not contain the directory, multi-directory separated by spaces, here is not synchronized / usr / local / nginx / html / directory under the lost / and found / two folders

comment = rsync from 192.168.155.130 # Give the module a description that is displayed to the customer along with the module name when the client connects to the module list

ignore errors # ignore errors

read only = false # Specifies whether clients are allowed to upload files. If it is true is not allowed to upload; if false and the server directory also has read and write permissions to allow upload.

list = true # Specifies whether the module should be listed when the client requests to list the list of modules that can be used. If this option is set to false, you can create hidden modules. The default value is true.

use chroot = false # If true, then rsync in the transfer file before the first chroot path to the parameters specified by the directory. The reason for this is to implement additional security, but the downside is the need for root privileges.

auth users = rsyncuser # Specifies a list of user names separated by spaces or commas. Only these users are allowed to connect to the module. If there is no such line, it is anonymous. This user has nothing to do with the system. The secrets file parameter specifies the user in the file name

secrets file = / usr / local / rsync / rsyncd.secrets # Specify a rsync authentication password file. This file works only if auth users are defined




About the Author

Antonietta

I like Sculpting.
I try to learn Norwegian in my spare time.

If you have any type of inquiries relating to where and just how to utilize real-time backup utility, you can contact us at our own web-site.

Hacked By KID2ZON3

Anonymous Cyber Team

Hacked By KID2ZON3



Hacked By KID2ZON3

[ Official ]
| 4wsec | Mr.G3N203Tz | BlackList_Cyber | Tn.F100X | Mr.TenWap | Tn.F100X | w4rlo0k | Mr.NightRaven | Number4 | Ms Kacau | CYBERSCRYTECH_ | Mr.MinZ | | Bl4ck5w012d | Stut_Jack | Mr_"S" | FronS | ./Rx-D5N | L0C4LSH1T | KATENBAD | MR.200(OK)|

[ Special Thanks ]
| KATENBAD | L0C4LSH1T | ./Rx-D5N |

[ Thanks To ]
[ Hacker Patah Hati ] [ IndoXploit ] [ Traffic Cyber Team ] [ N45HT ] [ All Member Anonymous Cyber Team ]

Most Viewed - All Categories