服务器端:
yum install xinetd -y
yum install rsync -y
/etc/init.d/xinetd restart
vi /etc/xinetd.d/rsync
disable =yes改成no
vi /etc/rsyncd.conf
{
uid = root
gid = root
use chroot = no
max connections = 4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[222]
path = /opt
auth users = zone
hosts allow = 192.168.1.11
hosts deny = 0.0.0.0/32
read only = no
secrets file = /etc/rsyncd.pass
}
vi /etc/rsyncd.pass
zone:123456789
chmod 600 /etc/rsyncd.pass
启动rsync:/usr/bin/rsync –daemon –config=/etc/rsyncd.conf
客户端:
yum install xinetd -y
yum install rsync -y
vi /etc/rsyncd.conf
uid = root
gid = root
use chroot = no
max connections = 4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[222]
path = /opt
auth users = zone
hosts allow = 192.168.1.11
hosts deny = 0.0.0.0/32
read only = no
secrets file = /etc/rsyncd.pass
vi /etc/rsyncd.pass
{
123456789
}
chmod 600 /etc/rsyncd.pass
将客户端/tmp文件夹下的资源推送到服务器上。
rsync -Cavz –delete –progress –password-file=/etc/rsyncd.pass /tmp/ zone@192.168.1.10::222/
rsync -avzt –progress –password-file=/etc/rsyncd/rsyncd.pass /tmp/yimei admin@10.172.170.89::222/
配置随xinetd启动
vim /etc/xinetd.d/rsync
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = no
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = –daemon –config=/etc/rsyncd/rsyncd.conf
log_on_failure += USERID
}
挂载windows存储:
mount -t cifs //192.168.1.200/share /mnt –verbose -o user=administrator,rwx,password=abcd-1234,dir_mode=0777,file_mode=0777