[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. Java Mail解决标题乱码问题

    在Java实现发送邮件功能时,直接使用 message.setSubject(subject) 的方式设置标题,在本地测试发送邮件的中文标题可以正常显示,但是将项目部署到服务器后,发送邮件的中文标题就 ...

  2. python之静态属性、类方法、静态方法

    静态属性.类方法.静态方法 1. 静态属性:在函数前加@property,将函数逻辑”封装“成数据属性,外部直接调用函数名,如同调用属性一样.这个函数是可以调用类和实例的属性的,    静态属性的作用 ...

  3. BZOJ 2631 [国家集训队]Tree II (LCT)

    题目大意:给你一棵树,让你维护一个数据结构,支持 边的断,连 树链上所有点点权加上某个值 树链上所有点点权乘上某个值 求树链所有点点权和 (辣鸡bzoj又是土豪题,洛谷P1501传送门) LCT裸题, ...

  4. 搭建hadoop java开发环境

    package hadoopDemo; import java.io.IOException; import java.net.URI; import java.net.URISyntaxExcept ...

  5. C# 上位机的USB设备拔插检测

    我们做USB通信时,通信成功后,往往要检测USB设备的拔插状态,这里就USB拔插进行一下说明. 参考:https://www.imooc.com/article/17438 先说明一下,我这里只是用C ...

  6. 【codeforces 738E】Subordinates

    [题目链接]:http://codeforces.com/problemset/problem/738/E [题意] 给你一个类似树形的关系; 然后告诉你某个人头顶上有多少个上司numi; 只有fat ...

  7. b.WHERE使用中多行子查询(适用于in,any,all条件)

    b.多行子查询(适用于in,any,all条件)   //查询与SCOTT和MARTIN在同一个部门的同事的编号和名称   select empno,ename   from emp   where ...

  8. ANY和ALL

    8.在WHERE中使用ANY和ALL条件   字段 >ANY(值1,值2,值3...):字段值大于集合任何一个       值就算满足条件.     字段 >ALL(值1,值2,值3... ...

  9. HDU 3073 Saving Beans

    Saving Beans Time Limit: 3000ms Memory Limit: 32768KB This problem will be judged on HDU. Original I ...

  10. mysql5.7官网直译SQL语句优化--分组优化

    1.14Group By Optimization 分组优化 大多数方法为了满足分组查询需要扫描整个表并且创建一个临时表,其中每组中的值都是连续的,如果可以使用聚合函数和临时表获取各个分组.在某些情况 ...