Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I tried to add a new user in solaris 10, but got an error:

$ useradd -g oinstall -G dba -d /export/home/oracle oracle
UX: useradd: ERROR: Inconsistent password files.  See pwconv(1M).

I ran pwconv, but nothing was displayed. I also tried to sync the shadow & passwd files, but there's still an error:

$ wc -l /etc/passwd /etc/shadow
  17 /etc/passwd
  17 /etc/shadow
  34 total
share|improve this question
    
Compare the passwd and the shadow file manually line by line. Maybe some lines are out of order.... –  Dayjay Mar 25 '11 at 7:05
    
@Dayjay i has manually checked 2 files, they has same line order –  QuanNH Mar 25 '11 at 8:28
add comment

2 Answers

Check the integrity of /etc/passwd and related files with pwck. Do the same for group related files with grpck.

share|improve this answer
    
i ran pwck & grpck, but nothing was displayed :( –  QuanNH Mar 28 '11 at 2:45
add comment

If you got that error it is because the user you wanted to add previously existed and was deleted. And since it existed in the /etc/passwd file, the system automatically created an encrypted passwd in the /etc/shadow for that user. Therefore when the user was deleted from the /etc/passwd, the encrypted passwd should have been deleted from the /etc/shadow file.

Put it this way: you can't add a user with the useradd command if a password already exists for that user in the /etc/shadow file.

Go to the /etc/shadow file and delete the password line for that user and then you'll be able to add the user.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.