Suse & OpenSuse : Tips, Tricks, Tutorials, How Tos and Troubleshooting

How to temporary disable users

From time to time, we will need to disable users.  This may be prior to the permanent deletion of the user account or just as a precautionary step.
As root, you can easily disable a user account by
# usermod –L <username>

Or you can just add an ! in front of the 2nd field (the encrypted [...]

How to create user with password assigned

If you create new users (as root) using
# useradd –m tux

You will have created a newuser with it being disabled.  This means that the password entry (the 2nd column) in the /etc/shadow will have a ! as the entry, i.e.
tux:!:14343:0:99999:7:::