Change/Deactivate the shell for an amount of users on SUSE Enterprise Server
- by Manfred Schmidt
I have a SUSE Server to which ~300 users are connecting.
About 100 of them have to be deactivated. I think it would be nice to change their shell to /bin/false either with chsh or with usermod.
Do I have to type every command per line, or can I fill out a list of users which can be read from the script?
I should mention that all of the 100 users have the same ending in their username. Can I work with wildcards here? e.g.
usermod -s /bin/fish *ftpuser
chsh -s /sbin/nologin *ftpuser