2

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
  • 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
1

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

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

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.

| improve this answer | |
  • Make sure to also check /etc/user_attr. This is checked in the useradd process too. – Ken J Feb 16 '15 at 12:21
0

Check file /etc/user_attr. If there is an entry for oracle, hash it out and run useradd command. User will get created and then enable the entry in /etc/user_attr. It worked for me.

| improve this answer | |
-1

Most likely your server is a NIS client and hence adding local users maybe forbidden. Just check if this is a part of NIS domain.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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