LINUX.ORG.RU

Помогите с rsync сервером через ssh.

 , ,


0

1

1. Поднял rsync:

 /etc/default/rsync:
RSYNC_ENABLE=true
RSYNC_CONFIG_FILE=/etc/rsyncd.conf


В конфиге:
cat /etc/rsyncd.conf:

max connections = 999
secrets file = /etc/rsyncd.conf
exclude = lost+found/ .sfolder/ .cache/
dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2 *.rar *.7z *.mp3 *.jpg
motd file = /etc/rsync.motd
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
transfer logging = true
uid = backup
gid = backup

[dictionary]
path = /var/share/dist/dictionary
comment = Dictionary data
secrets file = /etc/rsyncd.conf
read only = yes
list = yes
hosts allow = localhost 109.195.246.209 83.149.21.34
hosts deny = *

[meta]
path = /var/share/dist/meta
comment = Meta data
secrets file = /etc/rsyncd.conf
read only = yes
list = yes
auth users = user
hosts allow = localhost 109.195.246.209 83.149.21.34
host deny = *

[workload]
path = /var/share/dist/workload
comment = Meta data
secrets file = /etc/rsyncd.conf
read only = yes
list = yes
auth users = user
hosts allow = localhost 109.195.246.209 83.149.21.34
host deny = *


status:
splinter@pterores:/etc$ sudo service rsync status
● rsync.service - fast remote file copy program daemon
   Loaded: loaded (/lib/systemd/system/rsync.service; disabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-10-27 15:05:45 MSK; 8min ago
 Main PID: 11225 (rsync)
   Memory: 5.0M
   CGroup: /system.slice/rsync.service
           └─11225 /usr/bin/rsync --daemon --no-detach

Oct 27 15:05:45 server systemd[1]: Started fast remote file copy program daemon.


Коннект с клиента:
rsync.exe -avvv -e "ssh -p2222 -l A1Unit1" 82.99.22.21:/var/share/dist/dictionary ../home/sync/

Выхлоп:
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]
[sender] _exit_cleanup(code=12, file=io.c, line=226): about to call exit(12)
rsync: [Receiver] safe_read failed to read 4 bytes: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(276) [Receiver=3.2.3]
[Receiver] _exit_cleanup(code=12, file=io.c, line=276): about to call exit(12)


На сервере:
Oct 27 08:18:27 server systemd[1]: Created slice User Slice of A1Unit1.
Oct 27 08:18:27 server systemd[1]: Starting User Manager for UID 1001...
Oct 27 08:18:27 server systemd[1]: Started Session 278162234 of user A1Unit1.
Oct 27 08:18:27 server systemd[11592]: Failed to get udev device from devnum 0:170: No such device
Oct 27 08:18:27 server systemd[11592]: Failed to get udev device from devnum 0:170: No such device
Oct 27 08:18:27 server systemd[11592]: Reached target Timers.
Oct 27 08:18:27 server systemd[11592]: Reached target Paths.
Oct 27 08:18:27 server systemd[11592]: Reached target Sockets.
Oct 27 08:18:27 server systemd[11592]: Reached target Basic System.
Oct 27 08:18:27 server systemd[11592]: Reached target Default.
Oct 27 08:18:27 server systemd[11592]: Startup finished in 13ms.
Oct 27 08:18:27 server systemd[1]: Started User Manager for UID 1001.
Oct 27 08:18:27 server systemd[1]: Stopping User Manager for UID 1001...
Oct 27 08:18:27 server systemd[11592]: Reached target Shutdown.
Oct 27 08:18:27 server systemd[11592]: Starting Exit the Session...
Oct 27 08:18:27 server systemd[11592]: Stopped target Default.
Oct 27 08:18:27 server systemd[11592]: Stopped target Basic System.
Oct 27 08:18:27 server systemd[11592]: Stopped target Paths.
Oct 27 08:18:27 server systemd[11592]: Stopped target Timers.
Oct 27 08:18:27 server systemd[11592]: Stopped target Sockets.
Oct 27 08:18:27 server systemd[11592]: Received SIGRTMIN+24 from PID 11607 (kill).
Oct 27 08:18:27 server systemd[1]: Stopped User Manager for UID 1001.
Oct 27 08:18:27 server systemd[1]: Removed slice User Slice of A1Unit1.
Oct 27 08:18:27 server systemd[20268]: Failed to get udev device from devnum 0:170: No such device
Oct 27 08:18:27 server systemd[20268]: Failed to get udev device from devnum 0:170: No such device
Oct 27 08:18:27 server systemd[1]: Failed to get udev device from devnum 0:170: No such device
Oct 27 08:18:27 server systemd[1]: Failed to get udev device from devnum 0:170: No such device


Если пробовать без ssh:
rsync.exe 82.99.22.21::dictionary

, то в логе получаю сообщение:
2020/10/27 12:57:37 [12272] building file list
2020/10/27 12:57:37 [12272] rsync: change_dir "/" (in dictionary) failed: Permission denied (13)


Не понимаю какого он пытается сменить директорию на корневую и что я делаю не так.

★★★★★

Ответ на: комментарий от DiMoN

С ssh еще не пробовал, тут какая то другая странная проблема, при попытке закачать файл в 700 метров качка начинается, но почти докачав файл получаю:

2020/10/29 16:46:06 [11447] name lookup failed for 81.22.212.196: Name or service not known
2020/10/29 16:46:06 [11447] connect from UNKNOWN ( 81.22.212.196)
2020/10/29 16:46:07 [11447] rsync to A1Unit1/ from UNKNOWN ( 81.22.212.196)
2020/10/29 16:46:07 [11447] receiving file list
2020/10/29 16:46:07 [11447] Uploads/


2020/10/29 16:52:19 [11447] rsync: connection unexpectedly closed (82 bytes received so far) [generator]
2020/10/29 16:52:19 [11447] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [generator=3.1.1]


На клиенте при этом никаких сообщений.

splinter ★★★★★ ()