Deny user login to the system
nologin command can politely refuse the user to log in to the system and give information at the same time. If you try to log in as this type of user, add a record to the log, and then output the message "This account is currently not available" in the terminal, that's it. Generally, such an account is set up for the account that starts the service. It only allows the service to start, but cannot log in to the system.
nologinLinux prohibits user login:
After user login is prohibited, the user cannot log in to the system, but can log in to ftp, SAMBA, etc. When we perform system maintenance under Linux, we hope that individual users or all users cannot log in to the system to ensure that the system operates normally during the maintenance period. At this time we will prohibit users from logging in.
passwd -l lynnThis means locking the lynn user so that the user cannot log in.
passwd -u lynnThe above is to unlock the locked user lynn, and the user can log in.
vi /etc/passwdchange to:
lynn
500:500::/home/lynn:/sbin/nologinThe user will no longer be able to log in.
touch /etc/nologinUsers other than root cannot log in.