I was following the steps at http://bin63.com/how-to-setup-a-git-repository-on-freebsd to setup git on a server and when I went to setup the user with pw useradd the server said the user disappeared during config. Now when I try to do pw useradd it says the user already exists, but if I try pw userdel it says no such user, same with mod. The user doesn't show when I do pw usershow -a but is in /etc/passwd .

How do i get this user properly added?

migrated from serverfault.com Sep 16 '14 at 7:21

This question came from our site for system and network administrators.

  • Does the user exist in /etc/shadow too or only in /etc/passwd? – Jenny D Sep 11 '14 at 16:18
  • freebsd doesn't have shadow, but if I understand correctly the equivalent is master.passwd which it does show up in – aron.duby Sep 11 '14 at 16:26
up vote 7 down vote accepted

It looks like your /etc/pwd.db and/or /etc/spwd.db got out of sync, try running: pwd_mkdb /etc/master.passwd (make backup first!).

  • I ran pwd_mkdb against /etc/master.passwd and now they are showing up. running it on /etc/passwd gave a corrupted entry line #e inappropriate file type or format. Doesn't pwd_mkdb create the passwd from master.passwd though? – aron.duby Sep 11 '14 at 16:42
  • @aron.duby sorry, you're right just against /etc/master.passwd only. – alexus Sep 11 '14 at 16:44
  • awesome, thanks! Still getting used to freebsd – aron.duby Sep 11 '14 at 16:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.