Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, As a root user when I run the command - [root@localhost etc]# useradd foo useradd: unable to open password file Here is the /etc/passwd file specific details on my ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Posts
    2

    useradd: unable to open password file


    Hi,
    As a root user when I run the command -

    [root@localhost etc]# useradd foo
    useradd: unable to open password file

    Here is the /etc/passwd file specific details on my system

    [root@localhost etc]# ls -l /etc/passwd
    -rw-r--r-- 1 root root 2416 May 5 23:42 /etc/passwd

    [root@localhost etc]# lsattr passwd
    ------------- passwd
    [root@localhost etc]#

    Can some one please explain what should I do to resolve this issue?

    Regards,
    Hassan

  2. #2
    Just Joined!
    Join Date
    Jun 2005
    Posts
    54
    I quote a post from a site while googling your problem. Post back if you still run into trouble.


    I suppose this all depends on what "security work" in particular you've
    done on this box. My guess is that you've made /etc/passwd immutable:

    # cd /etc
    # chattr +i passwd
    # useradd foo
    useradd: unable to open password file
    # lsattr passwd
    ----i--- passwd
    # chattr -i passwd
    # lsattr passwd
    -------- passwd
    # useradd foo
    #

  3. #3
    Just Joined!
    Join Date
    Sep 2006
    Posts
    2
    Hi Tommo,
    I had stumbled upon this solution while doing Google for my problem. As you can see the result of lsattr /etc/passwd is same as given in the solution that you have given. I have tried these steps, but my problem is not solved. Waiting for other solutions from the group.

    Thanks for your response though.

    Regards,
    Hassan

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Mar 2011
    Posts
    1
    Quote Originally Posted by mhiqbal80 View Post
    Hi Tommo,
    I had stumbled upon this solution while doing Google for my problem. As you can see the result of lsattr /etc/passwd is same as given in the solution that you have given. I have tried these steps, but my problem is not solved. Waiting for other solutions from the group.

    Thanks for your response though.

    Regards,
    Hassan
    Hello....Den i will want u to try dis....

    chattr -ai /etc/passwd

    the above must solve ur Shits.... have a good day...!

    D'LiNux GeeK

Posting Permissions

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