How to Access ZMI if Zope Admin Password is Lost

This Plone tutorial can be helpful for those Quintagroup's clients who lost their Zope access password and fail to get to Zope Management Interface of their instance.

The following Plone Tutorial applies to Plone 4, Plone 3, and Plone 2.

In case you lost your Zope admin password and can not access ZMI, you can create emergency user to get access to ZMI. First of all, SSH into your account to see whether your Zope instance is:

  1. Traditional Zope Instance
  2. Buildout-based Zope Instance

Emergency Zope access user can be created with the zpasswd.py script, located in your Zope instance. Depending on the type your instance is (1 or 2), you will know where to find necessary script and how to deal with it.

After you got into you account, go to data1 folder that is usually located in the root of your account. Depending on what items are in data1 folder, you may know whether your Zope instance is a traditional or based on buildout.

1. How to Create Emergency Zope Access User in a Traditional Zope Instance

If you see that the instance in your account is an ordinary Zope instance - its content will look like this:

usual-instance

You can find zpasswd.py script in the bin folder of the installed Zope folder (Zope folder is usually located in the account root, on the same level as data1 folder).

  • As you SSH into your account, you get into your account root (your home)
  • To get to the bin folder of your installed Zope folder, type
    cd Zope-<version>/bin
    where Zope-<version>/bin - is a path to bin folder of your Zope folder
  • There is the necessary zpasswd.py script in the bin folder
    zpasswd
  • now type the following command
    ./zpasswd.py -u <user> -p <password> access
    where <user> - is an emergency user login name you are creating, <password> - password for this user to log in.
  • You will get a file access created in the bin folder
    access
  • Move this access file into data1 folder with the following command
    mv access ../../data1
    where ../../data1 - means 2 level higher to the root of your account and then into the data1 folder:
    instance
  • Now change your location form Zope folder/bin to data1/bin, and restart your instance
     cd ../../data1/bin 
    ./zopectl restart 
  • Login to ZMI with newly created emergency user login.
  • Create usual Zope admin user and login with it to do all the necessary stuff in ZMI.

2. How to Create Emergency Zope Access User in a  buildoout-based Zope Instance

If you see that the instance in your account was created with buildout - it includes buildout.cfg file in the instance root:

buildout

You can find zpasswd.py script in the utilities folder of the installed Zope folder - usually at the following location: data1/parts/zope2/utilities.

  • As you SSH into your account, you get into your account root (your home).
  • To get to the data1/parts/zope2/utilities folder, type
    cd data1/parts/zope2/utilities/
    where cd data1/parts/zope2/utilities/ - is a path to utilities folder, that contains zpasswd.py script
  • There is the necessary zpasswd.py script in the utilities folder
    zpasswd-bo
  • now type the following command
    ./zpasswd.py -u <user> -p <password> access
    where <user> - is an emergency user login name you are creating, <password> - password for this user to log in.
  • You will get a file access created in the utilities folder. 
  • Move this access file into your instance (data1/parts/instance) folder with the following command
    mv access ../../instance/
    where  ../../instance - means 2 level higher to the parts folder and then into the instance folder
    instance-bo
  • Now change your location form data1/parts/zope2/utilities to data1/bin, and restart your instance
    cd ../../../bin 
    ./instance restart
  • Login to ZMI with newly created emergency user login
  • Create usual Zope admin user and login with it to do all the necessary stuff in ZMI.

Connect with our experts Let's talk