Skip to content

Commit 6ab6a75

Browse files
committed
How to add an emergency user
1 parent 0096ec6 commit 6ab6a75

File tree

4 files changed

+80
-3
lines changed

4 files changed

+80
-3
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "How to add an emergency user to an existing Zope instance"
5+
"property=og:description": "How to add an emergency user to an existing Zope instance"
6+
"property=og:title": "Add an emergency user"
7+
"keywords": "Plone 6, create, add, factory, distributions"
8+
---
9+
10+
(add-an-emergency-user)=
11+
12+
# How to add an emergency user
13+
14+
This section explains how to add an emergency user to an existing Zope instance.
15+
16+
It assumes that you have already {doc}`installed </install/index>` Plone.
17+
18+
Some installation methods automatically create an emergency user for you already.
19+
20+
The credentials for the emergency user are usually:
21+
22+
- username: `admin`
23+
- password: `admin`
24+
25+
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.
26+
27+
```{note}
28+
The emergency user is a superuser with full access to the Zope instance. It is not limited to a specific Plone site.
29+
```
30+
31+
There are two ways to add an emergency user, depending on how your site was installed.
32+
33+
## Add an emergency user via an instance script
34+
35+
If your site was installed with `buildout`, you can add an emergency user via an instance script.
36+
37+
Run in the terminal:
38+
39+
```bash
40+
$ bin/instance adduser username password
41+
Created user: username
42+
```
43+
44+
The name of the instance script might vary based on your installation.
45+
Replace `username` and `password` with the desired values.
46+
47+
If the user already exists, no user will be created. The password will not be changed, e.g.:
48+
49+
```bash
50+
$ bin/instance adduser foo baz
51+
Created user: None
52+
```
53+
54+
## Add an emergency user via the addzopeuser script
55+
56+
For `pip` based installations will have a script called `addzopeuser` in the `bin` directory.
57+
58+
The `addzopeuser` script might also be available in `buildout` based installations.
59+
60+
Run in the terminal:
61+
62+
```bash
63+
$ .venv/bin/addzopeuser -c path/to/etc/zope.conf username password
64+
User username created.
65+
```
66+
67+
The `addzopeuser` script and `zope.conf` locations might vary based on your installations.
68+
Replace `username` and `password` with the desired values.
69+
70+
If the user already exists, no user will be created. The password will not be changed, e.g.:
71+
72+
```bash
73+
$ .venv/bin/addzopeuser -c tmp/zeoclient/etc/zope.conf foo baz
74+
Got no result back. User creation may have failed.
75+
Maybe the user already exists and nothing is done then.
76+
Or the implementation does not give info when it succeeds.
77+
```

submodules/plone.api

Submodule plone.api updated 58 files

submodules/plone.restapi

Submodule plone.restapi updated 378 files

submodules/volto

Submodule volto updated 5044 files

0 commit comments

Comments
 (0)