Skip to content

Commit

Permalink
How to add an emergency user
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-rt committed Feb 11, 2025
1 parent 0096ec6 commit 6ab6a75
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 3 deletions.
77 changes: 77 additions & 0 deletions docs/admin-guide/add-emergency-user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
myst:
html_meta:
"description": "How to add an emergency user to an existing Zope instance"
"property=og:description": "How to add an emergency user to an existing Zope instance"
"property=og:title": "Add an emergency user"
"keywords": "Plone 6, create, add, factory, distributions"
---

(add-an-emergency-user)=

# How to add an emergency user

This section explains how to add an emergency user to an existing Zope instance.

It assumes that you have already {doc}`installed </install/index>` Plone.

Some installation methods automatically create an emergency user for you already.

The credentials for the emergency user are usually:

- username: `admin`
- password: `admin`

Follow these instructions if you used an installation method that did not do this, or if you need to create a new emergency user for some reason.

```{note}
The emergency user is a superuser with full access to the Zope instance. It is not limited to a specific Plone site.
```

There are two ways to add an emergency user, depending on how your site was installed.

## Add an emergency user via an instance script

If your site was installed with `buildout`, you can add an emergency user via an instance script.

Run in the terminal:

```bash
$ bin/instance adduser username password
Created user: username
```

The name of the instance script might vary based on your installation.
Replace `username` and `password` with the desired values.

If the user already exists, no user will be created. The password will not be changed, e.g.:

```bash
$ bin/instance adduser foo baz
Created user: None
```

## Add an emergency user via the addzopeuser script

For `pip` based installations will have a script called `addzopeuser` in the `bin` directory.

The `addzopeuser` script might also be available in `buildout` based installations.

Run in the terminal:

```bash
$ .venv/bin/addzopeuser -c path/to/etc/zope.conf username password
User username created.
```

The `addzopeuser` script and `zope.conf` locations might vary based on your installations.
Replace `username` and `password` with the desired values.

If the user already exists, no user will be created. The password will not be changed, e.g.:

```bash
$ .venv/bin/addzopeuser -c tmp/zeoclient/etc/zope.conf foo baz
Got no result back. User creation may have failed.
Maybe the user already exists and nothing is done then.
Or the implementation does not give info when it succeeds.
```
2 changes: 1 addition & 1 deletion submodules/plone.api
Submodule plone.api updated 58 files
+8 −22 .editorconfig
+0 −22 .flake8
+32 −0 .github/workflows/black.yml
+4 −4 .github/workflows/docs.yml
+32 −0 .github/workflows/isort.yml
+0 −66 .github/workflows/meta.yml
+4 −10 .github/workflows/plone_python.yml
+0 −22 .github/workflows/rtd-pr-preview.yml
+26 −53 .gitignore
+0 −167 .meta.toml
+0 −95 .pre-commit-config.yaml
+0 −27 .readthedocs.yaml
+0 −5 .vscode/settings.json
+1 −189 CHANGES.rst
+1 −1 CONTRIBUTING.rst
+0 −2 MANIFEST.in
+62 −0 Makefile
+5 −1 README.md
+0 −11 dependabot.yml
+6 −1 docs/about.md
+22 −50 docs/conf.py
+0 −15 docs/content.md
+0 −240 docs/contribute.md
+299 −0 docs/contribute/develop.md
+24 −0 docs/contribute/index.md
+1 −1 docs/env.md
+1 −1 docs/group.md
+1 −1 docs/index.md
+2 −2 docs/portal.md
+1 −1 docs/relation.md
+12 −3 docs/user.md
+8 −8 fix-converted-myst.py
+5 −0 netlify.toml
+2 −149 pyproject.toml
+2 −3 requirements-docs.txt
+27 −0 setup.cfg
+13 −30 setup.py
+1 −2 src/plone/api/configure.zcml
+26 −41 src/plone/api/content.py
+1 −1 src/plone/api/env.py
+5 −10 src/plone/api/portal.py
+1 −1 src/plone/api/profiles/testfixture/metadata.xml
+4 −10 src/plone/api/profiles/testfixture/types.xml
+39 −61 src/plone/api/profiles/testfixture/types/Dexterity_Folder.xml
+39 −61 src/plone/api/profiles/testfixture/types/Dexterity_Item.xml
+18 −24 src/plone/api/relation.py
+10 −14 src/plone/api/testing.zcml
+2 −2 src/plone/api/tests/Dexterity_Folder.xml
+2 −2 src/plone/api/tests/Dexterity_Item.xml
+40 −65 src/plone/api/tests/test_content.py
+1 −1 src/plone/api/tests/test_doctests.py
+6 −7 src/plone/api/tests/test_env.py
+1 −1 src/plone/api/tests/test_group.py
+27 −35 src/plone/api/tests/test_portal.py
+8 −2 src/plone/api/tests/test_user.py
+2 −13 src/plone/api/user.py
+1 −1 src/plone/api/validation.py
+117 −249 tox.ini
2 changes: 1 addition & 1 deletion submodules/plone.restapi
Submodule plone.restapi updated 378 files
2 changes: 1 addition & 1 deletion submodules/volto
Submodule volto updated 5044 files

0 comments on commit 6ab6a75

Please sign in to comment.