Rsync 快速部署说明(密码验证版)
2010-10-08 16:56
387 查看
Rsync 快速部署说明(密码验证版)
version:1.0
date:2010-10-08
by:lijun--moko.cc
A服务器操作
1.下载最新版本rsync
wget http://www.samba.org/ftp/rsync/src/rsync-3.0.7.tar.gz 2.卸载自带rsync
yum remove rsync.i386
若64位系统用
yum remove rsync.x86_64
3.安装rsync
tar zxvf rsync-3.0.7.tar.gz
cd rsync-3.0.7
./configure
make && make install
/usr/local/bin/rsync --version (查看版本)
4.编辑服务配置文件
vi /etc/rsync.conf
输入以下内容
uid = nobody
gid = nobody
use chroot = no
max connections = 30
pid file = /var/run/rsync.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsync.log
[imgbak]
path = /图片路径
ignore errors
read only = true
list = no
auth users = mokoimg
secrets file = /etc/rsyncd.passwd
建立用户密码文件
vim /etc/rsyncd.passwd
mokoimg:123456
修改用户密码文件权限(必须为600)
chmod 600 /etc/rsyncd.passwd
加入防火墙规则
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 873 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp -m tcp --dport 873 -j ACCEPT
启动rsyncd
/usr/local/bin/rsync --daemon --config=/etc/rsync.conf
#######如有需要可将此路径加入path环境变量中 ###########
echo 'PATH=$PATH:/usr/local/bin' >> /etc/profile
echo 'export PATH' >> /etc/profile
source /etc/profile
B服务器操作
1.下载最新版本rsync
wget http://www.samba.org/ftp/rsync/src/rsync-3.0.7.tar.gz 2.卸载自带rsync
yum remove rsync.i386
若64位系统用
yum remove rsync.x86_64
3.安装rsync
tar zxvf rsync-3.0.7.tar.gz
cd rsync-3.0.7
./configure
make && make install
/usr/local/bin/rsync --version (查看版本)
建立密码文件
vim /etc/rsyncd.passwd
输入
123456
修改密码文件权限
chmod 600 /etc/rsyncd.passwd
/usr/local/bin/rsync -vzrtopg --progress --delete --password-file=/etc/rsyncd.passwd mokoimg@192.168.0.217::imgbak /imgbak
耐心等待就OK了
###########格式解释###########
--password-file= 密码文件位置
mokoimg@192.168.0.217::imgbak 用户名@源服务器地址::服务实例名称
/imgbak 同步到本地目录路径
#######如有需要可将此路径加入path环境变量中 ###########
echo 'PATH=$PATH:/usr/local/bin' >> /etc/profile
echo 'export PATH' >> /etc/profile
source /etc/profile
version:1.0
date:2010-10-08
by:lijun--moko.cc
A服务器操作
1.下载最新版本rsync
wget http://www.samba.org/ftp/rsync/src/rsync-3.0.7.tar.gz 2.卸载自带rsync
yum remove rsync.i386
若64位系统用
yum remove rsync.x86_64
3.安装rsync
tar zxvf rsync-3.0.7.tar.gz
cd rsync-3.0.7
./configure
make && make install
/usr/local/bin/rsync --version (查看版本)
4.编辑服务配置文件
vi /etc/rsync.conf
输入以下内容
uid = nobody
gid = nobody
use chroot = no
max connections = 30
pid file = /var/run/rsync.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsync.log
[imgbak]
path = /图片路径
ignore errors
read only = true
list = no
auth users = mokoimg
secrets file = /etc/rsyncd.passwd
建立用户密码文件
vim /etc/rsyncd.passwd
mokoimg:123456
修改用户密码文件权限(必须为600)
chmod 600 /etc/rsyncd.passwd
加入防火墙规则
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 873 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp -m tcp --dport 873 -j ACCEPT
启动rsyncd
/usr/local/bin/rsync --daemon --config=/etc/rsync.conf
#######如有需要可将此路径加入path环境变量中 ###########
echo 'PATH=$PATH:/usr/local/bin' >> /etc/profile
echo 'export PATH' >> /etc/profile
source /etc/profile
B服务器操作
1.下载最新版本rsync
wget http://www.samba.org/ftp/rsync/src/rsync-3.0.7.tar.gz 2.卸载自带rsync
yum remove rsync.i386
若64位系统用
yum remove rsync.x86_64
3.安装rsync
tar zxvf rsync-3.0.7.tar.gz
cd rsync-3.0.7
./configure
make && make install
/usr/local/bin/rsync --version (查看版本)
建立密码文件
vim /etc/rsyncd.passwd
输入
123456
修改密码文件权限
chmod 600 /etc/rsyncd.passwd
/usr/local/bin/rsync -vzrtopg --progress --delete --password-file=/etc/rsyncd.passwd mokoimg@192.168.0.217::imgbak /imgbak
耐心等待就OK了
###########格式解释###########
--password-file= 密码文件位置
mokoimg@192.168.0.217::imgbak 用户名@源服务器地址::服务实例名称
/imgbak 同步到本地目录路径
#######如有需要可将此路径加入path环境变量中 ###########
echo 'PATH=$PATH:/usr/local/bin' >> /etc/profile
echo 'export PATH' >> /etc/profile
source /etc/profile
相关文章推荐
- Rsync 快速部署说明(无密码验证版)
- linux文件备份:rsync快速部署
- rsync 服务快速部署手册
- 无密码身份验证:安全、简单且部署快速
- 无密码身份验证:安全、简单且部署快速
- elasticsearch-jdbc插件快速部署和要点说明
- 快速配置rsync用于无密码接收文件
- SNF开发平台WinForm之八-自动升级程序部署使用说明-SNF快速开发平台3.3-Spring.Net.Framework
- 有了Docker,一分钟就可以在你的笔记本上快速部署Spark集群
- CentOS 7安装部署Rsync数据同步服务器
- kubekit 快速离线部署工具
- 《暗黑世界GM管理后台系统》部署+功能说明文档
- 分享两个常用的脚本,适合快速部署虚拟机
- rsync无密码备份文件的方法
- [Android] Android Stuio 在函数前面快速生成说明注释和参数注释的方法
- 第二十二期 Linux安装/删除应用及快速部署http服务、FTP服务
- 关于asp.net利用mono部署到Linux上的一些说明
- 部署Hadoop集群前奏之ssh如何不输入密码在Master与Slave之间访问
- GZFramwork快速开发框架之窗体设计说明
- ElasticSearch学习10_ElasticSearch安装部署说明