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.

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:
    270
    Likes Received:
    0
    Trophy Points:
    16
    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:
    270
    Likes Received:
    0
    Trophy Points:
    16
    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