0

I manually edited /etc/passwd for non-root user - yeah, I know this is bad. Unfortunately I saw this (SSH failing authentication after manual edit of /etc/passwd and /etc/shadow) very late. I already recovered /etc/passwd to previous state, but something strange is happening on the server, for example:

useradd some_user

doesn't create home directory for this user, and doesn't ask about it password, authorization for old user is not working. I hope someone already encountered such a problem. P.S. I use Debian

kirugan
  • 105
  • 3

3 Answers3

6

useradd doesn't create the user's home directory by default, nor does it ask for a password. You can pass the -m flag to create the home directory, and just run passwd after creation to set the password.

man useradd will tell you more, obviously.

nickgrim
  • 4,336
  • 1
  • 17
  • 27
3

See the manpage for adduser:

useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead.

Dennis Kaarsemaker
  • 18,793
  • 2
  • 43
  • 69
2

next time if you must edit /etc/passwd use

vipasswd
Mike
  • 21,910
  • 7
  • 55
  • 79