[root@backup ~]# cat /etc/rsyncd.conf
#Rsync server
#created by oldboy
##rsyncd.conf start##
uid = rsync
gid = rsync
use chroot = no
max connections = 2000
timeout = 600
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
ignore errors
read only = false
list = false
hosts allow = 192.168.31.0/24
hosts deny =0.0.0.0/32
auth users = rsync_backup
secrets file = /etc/rsync.password
##################################
[backup]
comment = backup server by oldboy
path = /backup

[root@backup ~]# rsync --daemon

[root@backup ~]# echo "rsync --daemon" >>/etc/rc.local
[root@backup ~]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
rsync --daemon
[root@backup ~]#

[root@backup ~]# ps -ef |grep rsync|grep -v grep
root 2853 1 0 00:19 ? 00:00:00 rsync --daemon
[root@backup ~]# netstat -lntup|grep rsync
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 2853/rsync
tcp 0 0 :::873 :::* LISTEN 2853/rsync
[root@backup ~]# ss -lntup|grep rsync
tcp LISTEN 0 5 :::873 :::* users:(("rsync",2853,5))
tcp LISTEN 0 5 *:873 *:* users:(("rsync",2853,3))

[root@backup ~]# useradd rsync -s /sbin/nologin -M

[root@backup ~]# id rsync
uid=501(rsync) gid=501(rsync) groups=501(rsync)
[root@backup ~]#

[root@backup ~]# mkdir /backup
[root@backup ~]# chown -R rsync /backup/
[root@backup ~]# ls -ld /backup/
drwxr-xr-x 2 rsync root 4096 Jun 13 00:26 /backup/
[root@backup ~]#

[root@backup ~]# [root@backup ~]# chown -R rsync /backup/

[root@backup ~]# echo "rsync_backup:oldboy" >/etc/rsync.password
[root@backup ~]# cat /etc/rsync.password
rsync_backup:oldboy
[root@backup ~]#

[root@backup ~]# ll /etc/rsync.password
-rw-r--r-- 1 root root 20 Jun 13 00:31 /etc/rsync.password
[root@backup ~]# chmod 600 /etc/rsync.password
[root@backup ~]# ll /etc/rsync.password
-rw------- 1 root root 20 Jun 13 00:31 /etc/rsync.password
[root@backup ~]#

客户端

[root@lamp01 ~]# echo "oldboy" >/etc/rsync.password
[root@lamp01 ~]# chmod 600 /etc/rsync.password
[root@lamp01 ~]# ll /etc/rsync.password
-rw------- 1 root root 7 Jun 13 00:47 /etc/rsync.password

[root@lamp01 ~]# cat /etc/rsync.password

oldboy

[root@lamp01 ~]# rsync -avz /tmp/ rsync_backup@192.168.31.34::backup --password-file=/etc/rsync.password
sending incremental file list
./
liweiming/

sent 103 bytes received 17 bytes 240.00 bytes/sec
total size is 0 speedup is 0.00
[root@lamp01 ~]#

/etc/rsyncd.conf的更多相关文章

  1. rsyncd.conf

    rsyncd.conf 28 Jan 2018 rsyncd.conf(5) 28 Jan 2018 NAME rsyncd.conf - configuration file for rsync i ...

  2. rsyncd.conf配置文件

    rsyncd.conf配置文件     #Rsync server#created by oldboy 15:01 2009-6-5##rsyncd.conf start##uid = rootgid ...

  3. linux 修改 rsyncd.conf 配置文件

    [root@rsync-server-1 ~]# cat > /etc/rsyncd.conf << EOF #Rsync server #created by sunsky 00: ...

  4. rsyncd.conf 文件

    uid = nobodygid = nobodymax connections = 10timeout = 60use chroot = noread only = falsepid file=/va ...

  5. rsync.conf详解

    1.在服务端编辑配置文件 [root@game_intf ~]# more /etc/rsyncd.conf port=8730 log file=/var/log/rsync.log pid fil ...

  6. linux 同步备份 rsyncd 相关设置

    17:25 2013/10/18------------------ rsync linux 同步备份服务器 配置vi /etc/rsyncd.conf 配置文件 /usr/bin/rsync --d ...

  7. rsyncd启动脚本

    #!/bin/bash ############################################################## # File Name: -.sh # Versi ...

  8. rsyncd 配置使用

    查询rpm -qa | grep rsync 配置文件需手动创建: touch /etc/rsyncd.conf 配置/etc/rsyncd.conf: (全局配置) uid = root //rsy ...

  9. inux下配置rsyncd服务

    创建配置文件 touch /etc/rsyncd/rsyncd.conf #主配置文件 touch /etc/rsyncd/rsyncd.secrets #用户名密码文件,一组用户一行,用户名和密码使 ...

随机推荐

  1. struts 中数据处理的3中方式

    方式一: 获取servletapi中的对象 方式二: struts中封装的对象 方式三: 实现接口 方式一和方式二的区别 方式一需要额外引入包或者是方式二实现不了的功能,比如:获取url 因为方式二只 ...

  2. Hive 基本操作

    1.创建一个表 (字段表名不加引号‘,分隔符需要加引号) create table t1( id int ,name string ,hobby array<string> ,add ma ...

  3. Nutch2 WebPage写入数据库的过程分析

    版本: Nutch 2.2.1 本文通过InjectJob来追踪webpage的定义.创建.传递.序列化.写入数据库的整个过程.从源码中摘录了重要的代码行,并标明其所在文件名.行号. 1. 定义 sc ...

  4. java去除反复的字符串和移除不想要的字符串

    在java开发中碰到了有些字符串是反复的,假设在进行业务处理要所有遍历太对的数据就会反复,所以在进行业务处理前进行一个去重操作. watermark/2/text/aHR0cDovL2Jsb2cuY3 ...

  5. 【SPOJ-GSHOP】Rama and Friends【贪心】【细节】

    题意: 给出n个非严格递增的整数(可能有负数),必须操作k次.每次能够把当中一个数变为它的相反数,使得终于的数列和最大. 输出这个最大和. 考验怎样出坑数据卡自己的程序... #include < ...

  6. Leetcode--easy系列4

    #58 Length of Last Word Given a string s consists of upper/lower-case alphabets and empty space char ...

  7. java ee5的新特性

    1.标注 一种元数据,作用分为三类:编写文档@Document.代码分析@Deparecated(过时的)和编译检查@override(重写) 2.EJB3 EJB2的升级版,商业化的java bea ...

  8. hdu5240

    想了辣么多 貌似就一个条件 #include<bits/stdc++.h> using namespace std; int flag=0;int main(){int t,n,kase= ...

  9. Codeforces Round #261 (Div. 2)459A. Pashmak and Garden(数学题)

    题目链接:http://codeforces.com/problemset/problem/459/A A. Pashmak and Garden time limit per test 1 seco ...

  10. setsockopt 设置socket

    1.closesocket(一般不会立即关闭而经历TIME_WAIT的过程)后想继续重用该socket:BOOL bReuseaddr=TRUE;setsockopt(s,SOL_SOCKET ,SO ...