If you want to disable shell access for a specific user quickly then you can use the below command to achieve this,
root@server[#] chsh -s /bin/false username
Example ::
root@server[#] chsh -s /bin/false rajbirChanging shell for rajbir. Shell changed.OR
You can use the usemod command to change a user’s default shell
root@server[#] usermod -s /bin/false usernameExample ::
root@server[#] usermod -s /bin/false rajbir
