Part of our security audit we found that following system account's had shells configured;
sync
halt
shutdown
I believe this can be achieved by following commands:
chsh -s /sbin/nologin (user)
usermod -s /sbin/nologin (user)
However, I would like simple script to include these 3 account's only. Please can you advise on a simple script which can set this shell to nologin for these 3 users?