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

3

See the manpage for adduser:

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

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.

2

next time if you must edit /etc/passwd use

vipasswd
  • it will verify things are ok.. same with sudo.. visudo – Mike Mar 23 '13 at 18:34

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.