Change/Deactivate the shell for an amount of users on SUSE Enterprise Server

Posted by Manfred Schmidt on Server Fault See other posts from Server Fault or by Manfred Schmidt
Published on 2013-10-28T13:30:05Z Indexed on 2013/10/28 15:57 UTC
Read the original article Hit count: 218

Filed under:
|
|

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

© Server Fault or respective owner

Related posts about linux

Related posts about bash