How do you disable a user account on a Mac?
You can disable a user account by setting their shell to /usr/bin/false. Either run:
chsh -s /usr/bin/false
Another link: Link
The answer is given here:
With details on hiding given here:
pwpolicy can both disable and enable users, without losing their password
To disable the user pwpolicy -u username disableuser
To enable the user pwpolicy -u username enableuser
Use dscl to hide the user so they don't show on login: sudo dscl . create /Users/username IsHidden 1
To show a hidden user sudo dscl . create /Users/username IsHidden 0
More stuff to read here:
Where to put custom executables on a Mac so they are globally visible: /usr/local/bin/