I'm trying to create a user in RedHat 6.7 but it's not working

useradd testDoesn't give any errors, but /etc/passwd doesn't have the username

Thus passwd testis failing

  • when you say failing.. what is the error message ? – Kamaraj Oct 25 '16 at 4:39
  • @Kamaraj passwd: Unknown user name 'test'. – loo3y35 Oct 25 '16 at 4:45
  • Do this sudo useradd test; echo $? and id test. Let me know the result. – 林果皞 Oct 25 '16 at 4:51
  • @林果皞 useradd: warning: the home directory already exist. Not copying any file from skel directory into it. 0 – loo3y35 Oct 25 '16 at 4:57
  • @林果皞 id: test: No such user – loo3y35 Oct 25 '16 at 4:58

Remove any references to test user or group from files:

  • /etc/passwd
  • /etc/shadow
  • /etc/group

then do a sudo useradd test

  • That didn't work, all files don't have references to the username. I used grep. – loo3y35 Nov 2 '16 at 10:43

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.