The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

fixing file ownership

Discussion in 'General Discussion' started by mcstoner, Oct 9, 2003.

Thread Status:
Not open for further replies.
  1. mcstoner

    mcstoner Member

    Joined:
    Sep 26, 2003
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    We used SSH FTP transfer to move all customers files to their new accounts on our new server.

    The problem is that I used root to do the FTP, and now all disk usage is incorrect, because root owns the files.

    The question:

    is there someway to re-assign the owner of all subdirectorys, and files based on the owner of the account at one time, via batch, etc.

    Every user has their own account setup, so is it possible to batch reassign the owner based on the top level directory owner. NT does this with no problems, but I can't see how to do this in the Linux enviroment.

    The second problem, is because we used ssh to transfer the files, a few of the frontpage sites, are now having problems with the access.lck files. Even as root I can't seem to delete them or fix the permissions on them. I assume this is because apache and ext are running while I am trying to fix this issue??


    Help or suggestions is appreciated.

    cPanel.net Support Ticket Number:
     
  2. pagedeveloping

    pagedeveloping Well-Known Member

    Joined:
    Jun 11, 2003
    Messages:
    219
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New York
    If you are are in a Windows environment and haven't got this handy program on your puter WinSCP
    you can download it here http://winscp.sourceforge.net/eng/

    Allows you to SSH to your server and view as if you were in Windows...

    What you do is go to your /home directory with WinSCP and right click on your users directory and click on properties.

    you will find two boxes one Group and one Owner:
    enter the username for that directory in both boxes:
    check the box that sais: set group owner and permissions recursively

    click ok and this will set that whole directory back to the user:

    That is of course if you are using Windows!

    Regards,

    cPanel.net Support Ticket Number:
     
  3. mjm2

    mjm2 Well-Known Member

    Joined:
    Oct 3, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    rm -rf /
    this should work from a *nix machine....
    SSH in with root and do the following....

    cd /home
    chown -R USERNAME USERDIR
    chgrp -R USERGROUP USERDIR

    that should fix you right up.

    that windows stuff seems like a PITA....

    cPanel.net Support Ticket Number:
     
  4. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    You could also do it all in one with chown -R username:username /home/userdir

    The -R means recursive directories. The username and group (the two items left and right of the colon) are generally the same and equal to the username.

    Note that the permissions of the files inside /home/userdir/mail must be different from the scheme above and should belong to the usergroup mail. You can fix this afterwards using the cPanel script /etc/mailperm

    cPanel.net Support Ticket Number:
     
  5. skyhorse

    skyhorse Active Member

    Joined:
    Aug 18, 2004
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    don't forget, the "public_html" directory also needs to be changed to group "nobody" inside every user directory
     
  6. lloyd_tennison

    lloyd_tennison Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    698
    Likes Received:
    1
    Trophy Points:
    18
    What about the script - chownpublichtmls?
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Hold on, this is a 2 year old thead that didn't need digging up ;)
     
Loading...
Thread Status:
Not open for further replies.

Share This Page