Changing ownership of home folders

27,757

To flesh out the answer a bit, you may want to look at chown's man file before you do anything, but to change the owner of all files in /home/user, you'd do:

chown -hvR user /home/user

where "user" is the name of the owner you want to change it to.

Share:
27,757

Related videos on Youtube

Jeremy Statz
Author by

Jeremy Statz

Updated on September 18, 2022

Comments

  • Jeremy Statz
    Jeremy Statz over 1 year

    Okay, so I have a bit of a self-created problem. We were running out of space for SVN, so I moved our home folders to a new (much bigger) partition. This seemed to work fine at first, and SVN itself seems to be working no problem, as do file shares and so on... except I can no longer log in to Gnome.

    When I log in, I get a message telling me .dmrc can't be locked, and that the home folder must be owned by the user with 644 permissions. That sounds straightforward enough, so I log into an the fail-safe terminal to fix it.

    Logging in, I can see that the home folders are owned by root now (I assume this was a by-product of when I copied them). For some reason though, changing the owner with chown always tells me it's an invalid operation. Even if I use sudo I get that message.

    I've tried changing both ownership and permission on these folders and neither is working for me. Help?

    I'm trying this:

    sudo chown -R username /home/username
    
    • enzotib
      enzotib over 12 years
      You should probably remount the partition in read-write mode.
    • Caesium
      Caesium over 12 years
      Can you confirm the exact error message is "invalid operation" and not something similar like "operation not permitted"? It makes a big difference. I've never seen chown give "invalid operation" before myself. What filesystem is the new bigger partition? Are you sure it's a filesystem which supports chown?
  • Caesium
    Caesium over 12 years
    I'm not sure how this differs substantially (apart from setting the group, which you didn't explain) from what the OP has already tried in his Question?
  • david6
    david6 over 12 years
    as root, instead of sudo. include group (as you noted).
  • seb
    seb about 12 years
    the -v option can get quite excessive and make the task take felt longer.