Changing owner permissions with Rsync data - Suse

This is a discussion on Changing owner permissions with Rsync data - Suse ; I'm trying to rsync some data. Currently, I run the rsync script as a user, so the permissions are set for that user, as I want. I now want to run the script as root, as the new script will ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Changing owner permissions with Rsync data

  1. Changing owner permissions with Rsync data

    I'm trying to rsync some data. Currently, I run the rsync script as a
    user, so the permissions are set for that user, as I want.

    I now want to run the script as root, as the new script will be mixed
    with several other things that must be run as root. I've looked
    through the man page for rsync, but can't see anywhere where the user
    permissions could be set.

    An alternative would be to su to the user before that bit of the
    script is run, but that would mean that the user, having already
    entered the root password, would then have to enter the user
    password, which is a bit crap.

    Any ideas appreciated.
    --
    David Wilson Clarke

  2. Re: Changing owner permissions with Rsync data

    David Wilson Clarke wrote:
    > An alternative would be to su to the user before that bit of the
    > script is run, but that would mean that the user, having already
    > entered the root password, would then have to enter the user
    > password, which is a bit crap.


    I am sure there will be a way to keep the rights as they are, yet I do
    not know that. That said, if you are root and do `su user`, you do not
    need to enter a password.

    I have one script running that does this.

    houghi
    --
    If God doesn't destroy Hollywood Boulevard, he owes Sodom and
    Gomorrah an apology.

  3. Re: Changing owner permissions with Rsync data

    houghi wrote:

    > David Wilson Clarke wrote:
    >> An alternative would be to su to the user before that bit of the
    >> script is run, but that would mean that the user, having already
    >> entered the root password, would then have to enter the user
    >> password, which is a bit crap.

    >
    > I am sure there will be a way to keep the rights as they are, yet I
    > do not know that. That said, if you are root and do `su user`, you
    > do not need to enter a password.


    You can preserve the rights, but unfortunately in this case the source
    user is root, but I want the destination user to be different.

    On the 'su user' item, I did think about this. I'm going to start the
    script from a KDE desktop icon, which is set to run as root. I'm not
    sure if the calling user identity is preserved in this case, so would
    the script know it was returning to the calling user, or would it
    think it was a new user.

    Hmm, I ought to do a little test on that, should be easy enough to
    prove.

    --
    David Wilson Clarke

  4. Re: Changing owner permissions with Rsync data

    David Wilson Clarke wrote:
    > You can preserve the rights, but unfortunately in this case the source
    > user is root, but I want the destination user to be different.


    Why?

    > On the 'su user' item, I did think about this. I'm going to start the
    > script from a KDE desktop icon, which is set to run as root. I'm not
    > sure if the calling user identity is preserved in this case, so would
    > the script know it was returning to the calling user, or would it
    > think it was a new user.


    First: do not run it (initially) from an icon. Run it from a terminal
    with `set -x` in the beginning to see what is happening and what is not.

    > Hmm, I ought to do a little test on that, should be easy enough to
    > prove.


    I have a feeling you are thinking a bit in the wrong direction and try
    to solve a problem that should not be there in the first place.

    So you rsync dat from userA to userB. Two solutions.
    Put them in the same group, so both can read it
    Do a chown -R on the data as root.

    The first is prefered, the second is fast and dirty

    --
    houghi http://www.houghi.org
    My experience with SuSE Linux 9.1

    > The businessworld is like prison and M$ made everybody their bitch.


  5. Re: Changing owner permissions with Rsync data

    houghi wrote:

    > David Wilson Clarke wrote:
    >> You can preserve the rights, but unfortunately in this case the
    >> source user is root, but I want the destination user to be
    >> different.

    >
    > Why?
    >
    >> On the 'su user' item, I did think about this. I'm going to start
    >> the script from a KDE desktop icon, which is set to run as root.
    >> I'm not sure if the calling user identity is preserved in this
    >> case, so would the script know it was returning to the calling
    >> user, or would it think it was a new user.

    >
    > First: do not run it (initially) from an icon. Run it from a
    > terminal with `set -x` in the beginning to see what is happening and
    > what is not.


    Not played with that before, I'll have a look

    >> Hmm, I ought to do a little test on that, should be easy enough to
    >> prove.

    >
    > I have a feeling you are thinking a bit in the wrong direction and
    > try to solve a problem that should not be there in the first place.
    >
    > So you rsync dat from userA to userB. Two solutions.
    > Put them in the same group, so both can read it
    > Do a chown -R on the data as root.
    >
    > The first is prefered, the second is fast and dirty


    Doh, why did I not think of chown? That works for me.

    Thanks for your help.
    --
    David Wilson Clarke

  6. Re: Changing owner permissions with Rsync data

    David Wilson Clarke writes:

    >I'm trying to rsync some data. Currently, I run the rsync script as a
    >user, so the permissions are set for that user, as I want.


    >I now want to run the script as root, as the new script will be mixed
    >with several other things that must be run as root. I've looked
    >through the man page for rsync, but can't see anywhere where the user
    >permissions could be set.


    chown is your friend. Ie, just have root chown the backup files to the user


    >An alternative would be to su to the user before that bit of the
    >script is run, but that would mean that the user, having already
    >entered the root password, would then have to enter the user
    >password, which is a bit crap.


    No. And su from root does not require any passwords.


    >Any ideas appreciated.
    >--
    >David Wilson Clarke


  7. Re: Changing owner permissions with Rsync data

    Unruh wrote:

    > David Wilson Clarke writes:
    >
    >>I'm trying to rsync some data. Currently, I run the rsync script as
    >>a user, so the permissions are set for that user, as I want.

    >
    >>I now want to run the script as root, as the new script will be
    >>mixed with several other things that must be run as root. I've
    >>looked through the man page for rsync, but can't see anywhere where
    >>the user permissions could be set.

    >
    > chown is your friend. Ie, just have root chown the backup files to
    > the user


    Yes, I went the chown route, in the end.

    >>An alternative would be to su to the user before that bit of the
    >>script is run, but that would mean that the user, having already
    >>entered the root password, would then have to enter the user
    >>password, which is a bit crap.

    >
    > No. And su from root does not require any passwords.


    That's interesting. I didn't know that.

    Cheers.
    --
    David Wilson Clarke

+ Reply to Thread