/etc/passwd 对于非root用户 - 是的，我知道这很糟糕。 不幸的是，我看到了这个（ ssh失败身份验证手动编辑/ etc / passwd和/ etc / shadow ）很晚。 我已经恢复了
不会为此用户创建主目录，并且没有询问IT密码，旧用户的授权不起作用。 我希望有人已经遇到过这样的问题。 P.S.我使用debian
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:
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
See the manpage for adduser:
useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead.
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.
next time if you must edit /etc/passwd use