[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. CF894E Ralph and Mushrooms_强连通分量_记忆化搜索_缩点

    Code: #include<cstdio> #include<stack> #include<cstring> using namespace std; cons ...

  2. Pyhton学习——Day4

    '''y=2*x+1x=3y->7x=3y->7'''# def test(x):# '''# 2*x+1# :param x:整形数字# :return: 返回计算结果# '''# y= ...

  3. tcpsock.v2 与 ecocache

    因为很不满意 tcpsock 的设计与实现,及有意专为譬如游戏服务器端开发设计一套 TCP 网络库,所以年初即有了 tcpsock.v2 的开发计划,于是粗略整理出了以下几条目标计划: 1) TcpC ...

  4. vue登录

    <template> <section class="wrap-page wrap-page-u" style="padding-top:2rem;&q ...

  5. 【Tool】 深度学习常用工具

    1. caffe 网络结构可视化 http://ethereon.github.io/netscope/quickstart.html 将网络结构复制粘贴到左侧的编辑框,按Shift+Enter就可以 ...

  6. C语言实现将一个整形数转换为两个字节16进制

    有时候要用到这个转换,这里记录一下,例如把 int a = 164 转换储存在数组里为 uint8_t b[0]=0x00  , b[1]=0xA4 . 很简单,转换如下: b[0] = a > ...

  7. PatentTips - Object-oriented processor architecture and operating method

    BACKGROUND OF THE INVENTION The present invention relates to processors and computer systems. More s ...

  8. Nodejs RESTFul架构实践之api篇(转)

    why token based auth? 此段摘自 http://zhuanlan.zhihu.com/FrontendMagazine/19920223 英文原文 http://code.tuts ...

  9. POJ——T 3159 Candies

    http://poj.org/problem?id=3159 Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 33328   ...

  10. [using_microsoft_infopath_2010]Chapter6 发布提交表单数据

    本章概要: 1.使用正确的方法发布表单 2.发布表单画库到SharePoint 3.在发布和保存表单之间做出选择 4.理解不同发布表单方式之间的区别