How to Lock and Unlock Zimbra Accounts from Command Line

Zimbra is a popular email and collaboration platform that allows users to manage their email accounts, calendars, contacts, and more. As a Zimbra administrator, you may encounter situations where you need to lock or unlock user accounts. Locking an account temporarily disables the user’s ability to access their Zimbra services, while unlocking restores their access. This can be useful in cases where you suspect unauthorized access or need to temporarily restrict a user’s privileges.

In this step-by-step guide, we will explore how to lock and unlock Zimbra accounts using the command line interface. By following these instructions, you’ll be able to swiftly secure and reinstate user accounts as needed.

Step 1: Access the Zimbra Server:

To begin, establish a secure shell (SSH) connection to the Zimbra server. You will need administrative access and the appropriate credentials to proceed.

ssh [username]@[server_ip_address]

Replace [username] with your administrative username and [server_ip_address] with the IP address or hostname of the Zimbra server.

See also  How to Install ImageMagick and Imagick PHP extension in CentOS

Step 2: Lock a Zimbra Account:

To lock a Zimbra account, you’ll need to use the zmprov command, which is the Zimbra command line administration tool. Execute the following command:

zmprov modifyAccount [email_address] zimbraAccountStatus locked

Replace [email_address] with the email address of the account you want to lock.

For example:

[zimbra@mailbox ~]# zmprov ma userid@domain.com  zimbraAccountStatus lock

Step 3: Verify the Account Lock:

To ensure that the account has been successfully locked, you can run the following command:

zmprov ga [email_address] zimbraAccountStatus

This command will display the account status. If the status shows “locked,” then the account has been successfully locked.

See also  How to Install 389 Directory Server on CentOS 5.8

Step 4: Unlock a Zimbra Account:

If you need to unlock a previously locked Zimbra account, execute the following command:

zmprov modifyAccount [email_address] zimbraAccountStatus active

Replace [email_address] with the email address of the account you want to unlock.

Alternatively:

[zimbra@mailbox ~]# zmprov ma userid@domain.com  zimbraAccountStatus active

Step 5: Verify the Account Unlock:

To confirm that the account has been unlocked, you can run the following command:

zmprov ga [email_address] zimbraAccountStatus

The account status should now display “active,” indicating that the account has been successfully unlocked.

Commands Mentioned:

  • ssh – Secure shell command used to establish an SSH connection to the Zimbra server.
  • zmprov – Zimbra command line administration tool for managing Zimbra accounts.
See also  How to Install PyOpenGL package on Linux

Conclusion:

In this guide, we have learned how to lock and unlock Zimbra accounts using the command line interface. By leveraging the zmprov command, we can easily secure user accounts by locking them and reinstate their access by unlocking them when needed. This provides administrators with greater control and flexibility in managing Zimbra accounts.

Remember, it’s important to exercise caution when locking or unlocking accounts, as these actions directly impact user access to Zimbra services. Regularly review and monitor account statuses to maintain the security and integrity of your Zimbra environment.

We hope this guide has been helpful to you. If you have any comments or suggestions for improvement, please feel free to share them with us.

Comments

4 Comments

  • Avatar NorD says:

    locked

  • Avatar Naeem says:

    One of the account in zimbra Mailbox sending spam and zimbra administrator need to lock the account then ask user to reset their current password password immediately.

  • Avatar Vilk says:

    zimbraAccountStatus must be one of: active,maintenance,locked,closed,lockout,pending

  • Avatar Barr Pace says:

    I have been locked out of zimbracloud for 11 consecutive days. I have called every phone number that zimbra has listed many times. I can not access any of zimbra sites. Really BAD customer service.

Leave a Reply

Your email address will not be published. Required fields are marked *