您现在的位置是:网站首页> 编程资料编程资料
linux/centos rsync安装配置教程(实测通过)_资源网
2023-12-07
119人已围观
简介 linux/centos rsync安装配置教程(实测通过)_资源网
一、服务器端配置:
# yum -y install xinetd
# vi /etc/xinetd.d/rsync
将如下代码
service rsync
{
disable = yes
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = –daemon
log_on_failure += USERID
}
中的 disable = yes 改成 disable = no
然后启动 xinetd
# /etc/init.d/xinetd start 或 service xinetd restart
注意:如果服务器上装有防火墙记得要打开端口,默认端口是873
# telnet 127.0.0.1 873
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
# iptables -A INPUT -s 192.168.0.0/255.255.255.0 -p tcp -m tcp --dport 873 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp --dport 873 -j DROP
# vi /etc/rsyncd.conf (这个文件如果不存在自己创建)
#Global Settings
uid = root #以什么身份运行rsync
gid = root
use chroot = no #不使用chroot
max connections = 20 #最大连接数
secrets file = /etc/rsyncd.secrets #密码文件位置,认证文件设置,设置用户名和密码
log file = /var/log/rsyncd.log #指定rsync的日志文件,而不将日志发送给syslog
pid file = /var/run/rsyncd.pid #指定rsync的pid文件
lock file = /var/run/rsync.lock #指定支持max connections参数的锁文件,默认值是/var/run/rsyncd.lock
comment = hello world
#motd file = /etc/rsyncd.motd #欢迎信息文件名称和存放位置(此文件没有,可以自行添加)
[backup] # 这里是认证的模块名,在client端需要指定
path = /titan24/www/repos # 需要做镜像的目录
auth users = rsync # 授权帐号。认证的用户名,如果没有这行,则表明是匿名,多个用户用,分隔
read only = no # yes只读 值为NO意思为可读可写模式,数据恢复用NO
hosts allow = 192.168.3.128 #允许访问的服务器IP
hosts deny = * #黑名单
list = true # 允许列文件
#ignore errors # 可以忽略一些无关的IO错误
#exclude = cache/111/ cache/222/ #忽略的目录
# vi /etc/rsyncd.secrets (设置访问(认证)的用户名密码)
rsync:111111 #用户名:密
相关内容
- LNMP一键安装包清理mysql-bin.00001日志文件方法_资源网
- LNMP LNMPA 504 Gateway Time-out错误解决方法_资源网
- nginx支持.htaccess伪静态rewrite的方法_资源网
- php网站提示“您不具备查看该目录或页面的权限,因为访问控制列表(ACL)对Web服务器上的该资源进行了配置”的解决方法_资源网
- 配置Apache及实现多站点_资源网
- APMServ中Apache启动失败的解决方法_资源网
- 解决应用程序池被自动禁用的一种方法_资源网
- 天天炫斗凯瑟琳快速进阶攻略_手机游戏_游戏攻略_
- 神之刃冰霜巨龙埃斯点评_手机游戏_游戏攻略_
- 放开那三国物理输出武将排行榜_手机游戏_游戏攻略_