Look for a file called/etc/passwd.lock, find, to it with root delete it, it may be the last use of this file did not close properly.
Specific operation:
Switch to root user, use CD etc to the ETC directory, RM. Pwd.lock, (note. Pwd.lock This name may not be the same, you can go to the ETC directory to see)
Next look at how to create a new login account with the root account
How to create a new user under Linux under normal circumstances, in the security considerations, generally give themselves to create a normal user, instead of directly using the root user, because the permissions are large, wrong operation will easily lead to irreparable loss. In a Linux system, only the root user has permission to create other users.
The creation process is as follows:
useradd-d/home/newuser NewUser
This method sets the user's home directory and user name
But the light is not enough, but also for the user to explicitly set the password (even the second method is no exception, because this time using love as a password to log on to the system, still unable to log in), the command for passwd username;
[Email protected] ~]# passwd hudamin
Changing password for user hudamin.
New UNIX Password:
Bad password:it are too short
Retype new UNIX Password:
Passwd:all authentication tokens updated successfully.
When the system is logged in, it will prompt the user home directory is not created, so there is a lack of a step, that is, for the corresponding user to create a belong to the user's home directory, create a time to note that because the new user's home directory is created by root, but the Linux system requires the owner of the home directory must be the user itself , therefore, after you create the home directory with root, you need to replace the owner with the new user itself. The command is as follows:
Mkdir-p/home/newuser
Chown Newuser:newuser/home/newuser
Get! This can be used NewUser login ...
Linux Add user adduser appears useradd:cannot lock/etc/passwd; try again