This how to guide helps you to temporarily disable user account on Mac OS X. Note, it will not delete the user, this will just lock the user and it will not appear on the Mac startup login windows (fully disabled). When you want the user account back, simply enable it and use it. Never try to disable the currently logged in user or an administrator user account. When you need to disable an administrator account, another administrator account should exist and its enabled to login.
Disable user account in Mac OS X
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”.disable user account in Mac OS X.
Here you only 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.
Enable the user account back
As the disabled user account is disappeared from the system preferences, you need to enable the user through a command in terminal. You need to run the command as root user or as an admin privileged user. See the guide to enable the root user in Mac terminal. Run the below command as root.
It will open a configuration file of the user, press i to start editing the file, Find and change the value “Shell : /usr/bin/false” to “/bin/bash” to enable the user account back.
Press escape key and type
:x and press enter to save the configuration. Restart the Mac to take effect the changes.