Disable user account in Mac OS X with command prompt:
You can disable a user account by setting their shell to /usr/bin/false.
chsh -s /usr/bin/false , or change it in Users & Groups → Advanced Options.
To change it back, run
chsh -s /bin/bash
Disable user account in Mac OS X with UI:
Go to Apple menu and open “System Preferences” and click on “Users & Groups”. Then click on the lock symbol to make changes (type an administrator/current user password in the pop up window). Now right click on the user which you need to disable temporarily and click on “Advanced options”.
On the dialog box, you need to change the current shell of the user from /bin/bash to /usr/bin/false. (Take an extra care when you editing any value in this window). Change the shell and click OK and do restart your Mac.
The user is now disabled. Disabled users will not appear on the Mac startup login window or in Users & Groups section in System Preferences.