Create users and their home directories
Useradd-d/home/tomcat-m Tomcat
Then change the password
passwd Tomcat
Usermod-s/sbin/nologin + username Disable login ssh
Usermod-s/bin/bash + username default Add user This mode can be directly logged into SSH
Userdel only one parameter is optional-R; If you add the parameter-R, it will delete the user's home directory and the directory or file stored in the local mail together.
Useradd Tomcat
If there is no added directory, (/HOME/TOMCAT)
It is not possible to create a Tomcat folder under/home, due to the fact that the create_home in/etc/login.defs is set to No in/etc/login.defs.
Solution, plus a "-M"
Useradd-m Tomcat
passwd tomcat occurs when a password does not match: The following three files will restrict the password style
Bad Password:the PASSWORD is shorter than 8 characters
/etc/pam.d/system-auth
/etc/login.defs
/etc/pam.d/passwd
Linux about User Password Home directory summary