問題1:Rsync未何不需要設定密碼,也可以同步
問題2:rsync既然是由xinetd啟動,未何查看rsyncd.service服務顯示為關閉(xinetd有啟動,同步正常)
問題3:同步的密碼沒有設定,會有何安全上的風險
系統為CentOS 7.8 以下為server端的設定
[root@centos ~]# vim /etc/xinetd.d/rsync
service rsync
{
disable = no
flags = IPv4
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
[root@centos ~]# vim /etc/rsyncd.conf
[TYN]
path = /mnt/d/TYN
hosts allow = 192.168.16.2
hosts deny = *
list = true
uid = root
gid = root
read only = false
Clinet端設定
[root@centos ~]# vim /etc/lsyncd.conf
settings {
inotifyMode = "CloseWrite",
maxProcesses = 8,
statusInterval = 180,
statusFile = "/tmp/lsyncd.status",
logfile = "/var/log/lsyncd/lsyncd.log",
}
sync {
default.rsync,
source = "/mnt/d/TYN2",
target = "192.168.16.4::TYN",
init = false,
exclude = { ".*", "*.tmp", "*.swp", "*.bak", "*.log", "*.swx", "*.db"},
rsync = {
binary = "/usr/bin/rsync",
archive = true,
compress = true,
verbose = false,
_extra = {"--bwlimit=200"}
}
}
問題1:
手動傳輸成功
是因為我server端的rsyncd.conf沒有加secrets file = /etc/rsyncd.secrets 這行程式嘛???
所以手動傳輸時才不用在在多一行--password-file=/etc/rsyncd.secrets
[root@centos ~]# rsync --progress /mnt/d/lsync+rsync.txt 192.168.16.4::TYN
lsync+rsync.txt
4,650 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/1)
問題2:
檢視rsyncd.service顯示為關閉
[root@centos ~]# systemctl status rsyncd.service
\u25cf rsyncd.service - fast remote file copy program daemon
Loaded: loaded (/usr/lib/systemd/system/rsyncd.service; disabled; vendor preset: disabled)
Active: inactive (dead)