Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

wrong shadow and passwd files in /home/*/etc/

Discussion in 'General Discussion' started by equens, Sep 27, 2008.

  1. equens

    equens Well-Known Member

    Joined:
    Feb 8, 2002
    Messages:
    274
    Likes Received:
    2
    Trophy Points:
    316
    I have a problem with owner and group in passwd and shadow files in all entire home directory I am looking for a way to mass update all using the find command, can you help me, please?

    /home/user1/etc/domain1/passwd
    /home/user1/etc/domain1/shadow

    /home/user2/etc/domain2/passwd
    /home/user2/etc/domain2/shadow​

    I can find these files with
    HTML:
    find /home/*/etc/*/ -user root
    but I dont know how to replace * by username and domain to chown these files with something like
    HTML:
    chown username:username /home/username/ect/domain/
    I have considered to use /scripts/chownpublichtmls but in this server the /home/public_html directory is owned by username but the group is nobody.

    Thanks a lot.
     
  2. equens

    equens Well-Known Member

    Joined:
    Feb 8, 2002
    Messages:
    274
    Likes Received:
    2
    Trophy Points:
    316
    I'm not sure but I think this will find all files /home/user/etc/ and it will chage the owner and group but, how can I replace user* to do this in the entire home directory?

    HTML:
    find /home/user/etc/ -user root -print | xargs chown user:mail
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice