Berechtigung verweigert mit Rsync als root

Alle Themen, auf die ich gestoßen bin, betreffen rsync über ssh oder rsync einen Benutzer mit eingeschränktem Zugriff.

Ich erhalte die Berechtigung verweigert (13) Fehler als root. Hier sind meine Konfigurationsdateien:

/etc/rsyncd.conf:

auth users = backup, root
secrets file = /etc/rsyncd.secrets

[backupdir]
    path = /backupdir

/etc/rsyncd.Geheimnisse (Dateimodus 600, Eigentümer root, Gruppe root)

backup:backuppassword
root:rootpassword

Das Bash-Skript, das die rsync ausführt:

export RSYNC_PASSWORD=rootpassword

rsync -a --verbose --delete rsync://root@myserver/backupdir mydestination

Das obige Bash-Skript und mydestination befinden sich auf einem Win XP-Computer und myserver ist ein Debian Server.

Author: Ash, 2013-09-11

1 answers

Von der Hauptseite für rsyncd.conf:

auth users
       This parameter specifies a comma and space-separated list of usernames
       that will be allowed to connect to this module. The usernames do not need
       to exist on the local system. [...]

Dh die Benutzernamen, die Sie für den rsync-Daemon auswählen, sind nicht mit den gleichnamigen Systembenutzern verknüpft.

Sie können jedoch die Benutzer-ID und Gruppen-ID festlegen, die der rsync-Daemon beim Zugriff auf Dateien verwenden soll (zumindest wenn Sie den Daemon mit Root-Rechten gestartet haben):

uid    This  parameter  specifies  the user name or user ID that file transfers to
       and from that module should take place as when the daemon was run as root.
       In combination with the "gid" parameter this determines what file permissions
       are available. The default is uid -2, which is normally the user "nobody".

gid    This parameter specifies the group name or group ID that file transfers to
       and from that module should take place as when the daemon  was  run  as  root.
       This complements the "uid" parameter. The default is gid -2, which is normally
       the group "nobody".

Zum Beispiel:

uid = johndoe
gid = johndoe
 7
Author: n.st,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2018-09-05 17:45:08