Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: sudo chown -R doesn't work. I'm going slightly mad...

  1. #1
    Join Date
    Jun 2019
    Location
    Dirndl-land
    Beans
    686
    Distro
    Lubuntu 20.04 Focal Fossa

    sudo chown -R doesn't work. I'm going slightly mad...

    New Lubuntu install on a machine. New sudo/admin user works perfectly.
    Adding two new users also work as they should.

    Decided to clone my sudo admin user to one of the new users by copying /home/"sudousername" (including hidden files/dirs) to that user's /home directory.
    Also no problem.
    But changing the ownership of the new /home/... files/dirs is not possible. "chown" simply doesn't work,
    Code:
    sudo chown -R newuser:newuser /home/newuser/*
    I'm tearing my hairs out here. I can manually change every file's ownership in PCManFM-Qt, but that's no end tedious.
    Any ideas?

    Thanks.

  2. #2
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    I am not quite following what you're doing nor why but what is the final /* in your command; it is not needed às far as I can see?

    Using the -R option makes the command recursive and if there is a space between the /home/newuser and the following /*, which there appears to be, you are pointing at the root folder as well as that home folder, a very dangerous thing to do.
    Last edited by ajgreeny; March 9th, 2021 at 12:07 AM.

  3. #3
    Join Date
    Jun 2019
    Location
    Dirndl-land
    Beans
    686
    Distro
    Lubuntu 20.04 Focal Fossa

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    There's no space. Apparently [CODE] makes it look that way.
    Last edited by ml9104; March 9th, 2021 at 12:10 AM.

  4. #4
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    OK, but I still don't think it's needed as the -R option means everything in /home/newuser will change, or should change ownership without that final /*.

    Perhaps that is what is stopping the change from happening.

  5. #5
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,306

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    This should work:
    $ sudo chown -R newuser: /home/newuser

    unless you have AppArmor enabled.

    (If you are wondering about the syntax, the : implies the same user and group)

  6. #6
    Join Date
    Jun 2019
    Location
    Dirndl-land
    Beans
    686
    Distro
    Lubuntu 20.04 Focal Fossa

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    Interesting.
    I'll try with
    Code:
    sudo chown -R /home/newuser

  7. #7
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    That won't work; you must have the newuser: for the command to know who the user is to be changed to.
    Without that information nothing will change.

  8. #8
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,197
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    To be specific - like this:
    Code:
    sudo chown -R newuser:newuser /home/newuser
    An extra gotcha using /home/newuser/* is that the * only expands to be all visible files, and would not include hidden items like .config or .bashrc.

  9. #9
    Join Date
    May 2010
    Beans
    1,198

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    Why is this being ran at all? Seems weird............

  10. #10
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: sudo chown -R doesn't work. I'm going slightly mad...

    Quote Originally Posted by ActionParsnip View Post
    Why is this being ran at all? Seems weird............
    Agreed; hence my post #2 asking what it was all for.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •