xinted結合rsync 無密碼使用

xinted結合rsync 無密碼使用

1.安裝

 yum install -y xinetd rsync

2.配置

 cat /etc/xinetd.d/rsync

# default: off
# 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
	log_on_failure  += USERID
}

 cat /etc/rsyncd.conf

uid = root
git = root
use chroot = no
max connections = 4
strict modes = yes
port = 873
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log

[backup]
path = /srv
comment = this is test
#host allow = 
read only = no

3.啓動

/etc/init.d/xinetd start

4.使用

rsync -Rrav --delete /data/web/ IP::backup


# 注: 一定要檢查selinux是不是disabled,否則不能同步

# 沒有關閉selinux的報錯
receiving incremental file list
rsync: opendir "/." (in backup) failed: Permission denied (13)

sent 28 bytes  received 136 bytes  46.86 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1505) [generator=3.0.6]

修改:

# 臨時更改
[root@localhost backup]# getenforce 
Enforcing
[root@localhost backup]# setenforce 0
[root@localhost backup]# getenforce 
Permissive
# 永久更改
在 /etc/selinux/config 文件中修改爲如下:
SELINUX=disabled


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章