rsync 服务配置
rsync(remote synchronizetion) 意为远程数据同步。
服务器配置
#开启xinetd.d下服务
service rsync
{disable = onflags = IPv6socket_type = streamwait = nouser = rootserver = /usr/bin/rsyncserver_args = --daemonlog_on_failure += USERID
}[root@ton ~]#chkconfig --list
atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
...
xinetd based services:echo-dgram: offecho-stream: offrsync: ontcpmux-server: offtelnet: ontime-dgram: offtime-stream: off
[root@ton ~]#
[root@ton ~]#useradd rsync -s /sbin/nologin -M
[root@ton ~]#chown rsync.rsync ./backup/ #目标目录[root@ton ~]#echo "tom_backup:test12" > /etc/rsync.password #配置密码文件
[root@ton ~]#chmod 600 /etc/rsync.password
rsyncd.conf配置
rsync服务器端
[root@ton bin]#cd /etc/xinetd.d/
[root@ton xinetd.d]#vim rsync
[root@ton xinetd.d]#service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[root@ton xinetd.d]# lsof -i tcp:873
[root@ton xinetd.d]# rsync --daemon
[root@ton xinetd.d]# lsof -i tcp:873
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rsync 2107 root 4u IPv4 13354 0t0 TCP *:rsync (LISTEN)
rsync 2107 root 5u IPv6 13355 0t0 TCP *:rsync (LISTEN)
[root@ton ~]#ps -ef |grep rsync
root 1677 1 0 23:22 ? 00:00:00 rsync --daemon
root 1679 1643 0 23:22 pts/1 00:00:00 grep rsync
[root@ton xinetd.d]#netstat -lnutp |grep rsync
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 2107/rsync
tcp 0 0 :::873 :::* LISTEN 2107/rsync
rsync客户端
[root@paly ~]#echo "tontom" > /etc/rsync.password #配置密码
[root@paly ~]#rsync -avz test.txt tom_backup@192.168.31.223::backup --password-file=/etc/rsync.password
sending incremental file list
test.txtsent 79 bytes received 27 bytes 212.00 bytes/sec
total size is 10 speedup is 0.09
报错
未到达对方主机,这里简单关闭iptabls
[root@paly ~]#rsync -avz test.txt root@192.168.31.223::backup --password-file=/etc/rsync.password
rsync: failed to connect to 192.168.31.223: No route to host (113)
rsync error: error in socket IO (code 10) at clientserver.c(124) [sender=3.0.6]
[root@ton ~]#service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
使用服务器端配置文件中的用户,上面我设置的为tom_backup
[root@paly ~]#rsync -avz test.txt root@192.168.31.223::backup --password-file=/etc/rsync.password
@ERROR: auth failed on module backup
rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]
查看日志
/var/log/rsyncd.log
rsync 服务配置相关推荐
- Linux Rsync 服务配置
一.Rsync简介 rsync是Linux.UNIX系统下的数据镜像备份工具,它的特性如下: 1.可以镜像保存整个目录树和文件系统. 2.可以很容易做到保持原来文件的权限.时间.软硬链接等等. 3.无 ...
- Rsync服务配置详解,实现服务器间数据同步!
1.1 什么是rsync? rsync是Unix下的一款应用软件,它能同步更新两处计算机的文件与目录,并适当利用差分编码以减少数据传输.rsync中一项与其他大部分类似程序或协议中所未见的重要特性是镜 ...
- rsync同步服务配置手记
Rsync在推送或抓取数据时,在rsync客户端会出现性能问题, 负载比较大且数据量比较大的生产环境要注意这一点. 本文只是个人平时配置示例,可以简单修改后用于实际环境使用,rsync不仅可以实现服务 ...
- 使用 rsync 服务(二)
内容提要 掌握两种运行 rsync 服务的配置方法 熟悉配置文件 rsyncd.conf 的常用参数 掌握在生产服务器上同时运行 rsync 服务的配置方法 掌握在备份服务器上运行 rsync 服务的 ...
- rsync 服务与配置文档
rsync 服务与配置文档 1 某项目rsync配置文档(关键字已处理) $ cat /etc/rsyncd.conf #全局配置 log file = /var/log/rsyncd.log ...
- rsync服务及配置
rsync 1. rsync简介 rsync是linux系统下的数据镜像备份工具.使用快速增量备份工具Remote Sync可以远程同步,支持本地复制,或者与其他SSH.rsync主机同步. 2. r ...
- Rsync服务让SLB下多台centos服务器文件同步更新
需求目的 是为了使俩台集群下的俩台服务器 实现数据同步 及真正的备份 所以负载均衡 加上rsync是一个完美的结合 下面的操作是针对阿里云的SLB 服务,SLB服务 是由tengine与lvs所组成的 ...
- rsync的配置应用
高可用软件:keepalived 负载均衡:nginx/lvs/haproxy web服务器:nginx/apache 数据库:MySQL/MongoDB/Oracle 存储:NFS/FastdFS/ ...
- rsync命令_浅谈利用rsync服务的攻击
本文将根据针对Linux操作系统上不安全的Rsync配置,浅谈如何利用rsync服务进行攻击. 1.什么是RSYNC? Rsync是用于在两个服务器(通常是Linux)之间传输和同步文件的实用程序.它 ...
最新文章
- 如何理解李飞飞价值十亿美金的“人文AI”计划 ?
- 【MM模块】 Cash Discounts 现金折扣
- 35数据结构与算法分析之---最短路径
- SDK 操作 list-view control 实例 -- 遍历进程
- mac下安装与配置mysql数据库,Mac下MySQL的安装与配置
- hihoCoder 1175 拓扑排序
- oracle 自定义表类型赋值,Oracle自定义类型 Record + PL/SQL表
- 解决PyScripter中文乱码问题
- BIG5码转换为GB2312码的方法
- 为什么有些程序员明明很努力,但是却回报很低,收益很小,工资始终上不去-出自中华石杉老师
- 电脑怎么显示文件后缀名?3个步骤
- 51单片机蜂鸣器播放音乐C语言程序实例,51单片机 使用蜂鸣器播放简单音乐
- python有理数_Python3标准库:fractions有理数
- 再见,2017,你好,2018
- maven项目install报错:\target\surefire-reports for the individual test results
- 京东双11准点秒杀脚本
- loopback接口介绍
- Tetrate万凯:SkyWalking MAL的监控虚拟机和Kubernetes实践
- win10 localhost拒绝访问
- htc hd如何刷新官方升级包--转symen
热门文章
- 主从D触发器的门级建模
- STM32F4_DS18B20红外温度传感器
- Understand基本使用
- springcloud config配置中心 访问报错:java.security.InvalidAlgorithmParameterException: the trustAnchors param
- java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
- 双反相机史话(41)日本双反机(8)Minolta 美能达双反机
- Keepalive介绍
- Eclipse打包出现错误:XXX is not translated in af (Afrikaans), am (Amharic), ar (Arabic).....
- Go下载第三方包、git下载包:常见问题汇总
- 同步容器与并发容器类简介