rsync sends file to remote daemon server but keeps original ownership and group
up vote
1
down vote
favorite
When running the following command, I hope the ownership and group id (o-and-g) is remained in the remote rsync daemon server. However, every file has the o-and-g the same as configured in rsync.conf
, [uid] and [gid].
sudo rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} rsync_backup@[ipv6]::backupfiles --password-file=/etc/rsyncd.passonly
So my question is, how to keep the same o and g instead of using the ones in rsync.conf? Do these users and groups need to be present on that server?
linux rsync
add a comment |
up vote
1
down vote
favorite
When running the following command, I hope the ownership and group id (o-and-g) is remained in the remote rsync daemon server. However, every file has the o-and-g the same as configured in rsync.conf
, [uid] and [gid].
sudo rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} rsync_backup@[ipv6]::backupfiles --password-file=/etc/rsyncd.passonly
So my question is, how to keep the same o and g instead of using the ones in rsync.conf? Do these users and groups need to be present on that server?
linux rsync
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
When running the following command, I hope the ownership and group id (o-and-g) is remained in the remote rsync daemon server. However, every file has the o-and-g the same as configured in rsync.conf
, [uid] and [gid].
sudo rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} rsync_backup@[ipv6]::backupfiles --password-file=/etc/rsyncd.passonly
So my question is, how to keep the same o and g instead of using the ones in rsync.conf? Do these users and groups need to be present on that server?
linux rsync
When running the following command, I hope the ownership and group id (o-and-g) is remained in the remote rsync daemon server. However, every file has the o-and-g the same as configured in rsync.conf
, [uid] and [gid].
sudo rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} rsync_backup@[ipv6]::backupfiles --password-file=/etc/rsyncd.passonly
So my question is, how to keep the same o and g instead of using the ones in rsync.conf? Do these users and groups need to be present on that server?
linux rsync
linux rsync
edited Nov 21 at 1:37
asked Nov 20 at 10:49
Tiina
5781614
5781614
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
rsync
can only change the owner and group to the original when running as root. As you have apparently set a non-root UID in the rsyncd.conf file, rsync
can only store files as that user. This is a security measure imposed by the operating system, so that ordinary users cannot create files and change the owner to some other user.
Note that runningrsync
withsudo
runs it as root on the local computer, but has no effect on the remote computer.
– Gordon Davisson
Nov 20 at 17:27
if a local file has owner Tom, does he has to be present on remote rsync daemon server host?
– Tiina
Nov 21 at 1:38
@Tiina if you use--numeric-ids
then only the numeric values of the UID and GID are transferred; normallyrsync -og
will try to preserve the owner and group by name, even if the numeric values are different (e.g. Tom has uid 123 on the source and uid 234 on the destination, then Tom's files will have uid 234 on the destination; with--numeric-ids
then Tom won't own those files on the destination). If no match can be found for the name, then the numeric value will be used anyway.
– wurtel
Nov 29 at 9:37
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
rsync
can only change the owner and group to the original when running as root. As you have apparently set a non-root UID in the rsyncd.conf file, rsync
can only store files as that user. This is a security measure imposed by the operating system, so that ordinary users cannot create files and change the owner to some other user.
Note that runningrsync
withsudo
runs it as root on the local computer, but has no effect on the remote computer.
– Gordon Davisson
Nov 20 at 17:27
if a local file has owner Tom, does he has to be present on remote rsync daemon server host?
– Tiina
Nov 21 at 1:38
@Tiina if you use--numeric-ids
then only the numeric values of the UID and GID are transferred; normallyrsync -og
will try to preserve the owner and group by name, even if the numeric values are different (e.g. Tom has uid 123 on the source and uid 234 on the destination, then Tom's files will have uid 234 on the destination; with--numeric-ids
then Tom won't own those files on the destination). If no match can be found for the name, then the numeric value will be used anyway.
– wurtel
Nov 29 at 9:37
add a comment |
up vote
3
down vote
accepted
rsync
can only change the owner and group to the original when running as root. As you have apparently set a non-root UID in the rsyncd.conf file, rsync
can only store files as that user. This is a security measure imposed by the operating system, so that ordinary users cannot create files and change the owner to some other user.
Note that runningrsync
withsudo
runs it as root on the local computer, but has no effect on the remote computer.
– Gordon Davisson
Nov 20 at 17:27
if a local file has owner Tom, does he has to be present on remote rsync daemon server host?
– Tiina
Nov 21 at 1:38
@Tiina if you use--numeric-ids
then only the numeric values of the UID and GID are transferred; normallyrsync -og
will try to preserve the owner and group by name, even if the numeric values are different (e.g. Tom has uid 123 on the source and uid 234 on the destination, then Tom's files will have uid 234 on the destination; with--numeric-ids
then Tom won't own those files on the destination). If no match can be found for the name, then the numeric value will be used anyway.
– wurtel
Nov 29 at 9:37
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
rsync
can only change the owner and group to the original when running as root. As you have apparently set a non-root UID in the rsyncd.conf file, rsync
can only store files as that user. This is a security measure imposed by the operating system, so that ordinary users cannot create files and change the owner to some other user.
rsync
can only change the owner and group to the original when running as root. As you have apparently set a non-root UID in the rsyncd.conf file, rsync
can only store files as that user. This is a security measure imposed by the operating system, so that ordinary users cannot create files and change the owner to some other user.
answered Nov 20 at 10:53
wurtel
1,19647
1,19647
Note that runningrsync
withsudo
runs it as root on the local computer, but has no effect on the remote computer.
– Gordon Davisson
Nov 20 at 17:27
if a local file has owner Tom, does he has to be present on remote rsync daemon server host?
– Tiina
Nov 21 at 1:38
@Tiina if you use--numeric-ids
then only the numeric values of the UID and GID are transferred; normallyrsync -og
will try to preserve the owner and group by name, even if the numeric values are different (e.g. Tom has uid 123 on the source and uid 234 on the destination, then Tom's files will have uid 234 on the destination; with--numeric-ids
then Tom won't own those files on the destination). If no match can be found for the name, then the numeric value will be used anyway.
– wurtel
Nov 29 at 9:37
add a comment |
Note that runningrsync
withsudo
runs it as root on the local computer, but has no effect on the remote computer.
– Gordon Davisson
Nov 20 at 17:27
if a local file has owner Tom, does he has to be present on remote rsync daemon server host?
– Tiina
Nov 21 at 1:38
@Tiina if you use--numeric-ids
then only the numeric values of the UID and GID are transferred; normallyrsync -og
will try to preserve the owner and group by name, even if the numeric values are different (e.g. Tom has uid 123 on the source and uid 234 on the destination, then Tom's files will have uid 234 on the destination; with--numeric-ids
then Tom won't own those files on the destination). If no match can be found for the name, then the numeric value will be used anyway.
– wurtel
Nov 29 at 9:37
Note that running
rsync
with sudo
runs it as root on the local computer, but has no effect on the remote computer.– Gordon Davisson
Nov 20 at 17:27
Note that running
rsync
with sudo
runs it as root on the local computer, but has no effect on the remote computer.– Gordon Davisson
Nov 20 at 17:27
if a local file has owner Tom, does he has to be present on remote rsync daemon server host?
– Tiina
Nov 21 at 1:38
if a local file has owner Tom, does he has to be present on remote rsync daemon server host?
– Tiina
Nov 21 at 1:38
@Tiina if you use
--numeric-ids
then only the numeric values of the UID and GID are transferred; normally rsync -og
will try to preserve the owner and group by name, even if the numeric values are different (e.g. Tom has uid 123 on the source and uid 234 on the destination, then Tom's files will have uid 234 on the destination; with --numeric-ids
then Tom won't own those files on the destination). If no match can be found for the name, then the numeric value will be used anyway.– wurtel
Nov 29 at 9:37
@Tiina if you use
--numeric-ids
then only the numeric values of the UID and GID are transferred; normally rsync -og
will try to preserve the owner and group by name, even if the numeric values are different (e.g. Tom has uid 123 on the source and uid 234 on the destination, then Tom's files will have uid 234 on the destination; with --numeric-ids
then Tom won't own those files on the destination). If no match can be found for the name, then the numeric value will be used anyway.– wurtel
Nov 29 at 9:37
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376929%2frsync-sends-file-to-remote-daemon-server-but-keeps-original-ownership-and-group%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown