Skip to content

Commit 6692187

Browse files
authored
Merge pull request #1854 from plone/ale/add-zope-user
Zope Manager Users
2 parents 94baa83 + 9d3abb9 commit 6692187

File tree

5 files changed

+117
-84
lines changed

5 files changed

+117
-84
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "How to create an emergency user in an existing Zope instance"
5+
"property=og:description": "How to create an emergency user in an existing Zope instance"
6+
"property=og:title": "How to create an emergency user"
7+
"keywords": "Plone, Zope, users, emergency user, administration, pip, buildout"
8+
---
9+
10+
(user-groups-emergency-user-label)=
11+
12+
# Zope Manager Users
13+
14+
Zope manager users have full access to the whole Zope instance.
15+
16+
Some installation methods automatically create a zope admin user for you already.
17+
18+
The credentials for this user are usually:
19+
20+
- username: `admin`
21+
- password: `admin`
22+
23+
There are multiple reasons why you might need to add a new Zope manager user, such as:
24+
25+
- Your installation method did not create one.
26+
- You lost access to your instance.
27+
- You inherited a project without proper documentation.
28+
29+
If you need to regain access to your instance, this user is also refered to as an emergency user.
30+
31+
This guide explains how to add a Zope manager user to an existing Zope instance.
32+
33+
```{note}
34+
The emergency user is a superuser with full access to the Zope instance.
35+
It is not limited to a specific Plone site.
36+
Please be aware of the security implications.
37+
```
38+
39+
(user-groups-create-an-emergency-user-label)=
40+
41+
## Adding a New Zope Manager User
42+
43+
There are multiple ways to create a Zope manager user, depending on how you created and managed your Zope instance.
44+
45+
```{important}
46+
If you are running a standalone instance, it must be stopped before adding the user.
47+
```
48+
49+
### Using the `adduser` instance command
50+
51+
If your site was installed with `buildout`, you can add a Zope manager user via an instance script.
52+
53+
Run the following command in the terminal:
54+
55+
```bash
56+
$ bin/instance adduser username password
57+
Created user: username
58+
```
59+
60+
The name of the instance script might vary based on your installation.
61+
Replace `username` and `password` with the desired values.
62+
63+
If the user already exists:
64+
65+
- No user will be created
66+
- The password will not be changed
67+
68+
The command will return a message like this:
69+
70+
```bash
71+
$ bin/instance adduser foo baz
72+
Created user: None
73+
```
74+
75+
### Using the `addzopeuser` command
76+
77+
For `pip` based installations, you will have a script called `addzopeuser` in the `bin` directory of your virtual environment.
78+
79+
The `addzopeuser` script might also be available in `buildout` based installations.
80+
81+
Run in the terminal:
82+
83+
```bash
84+
$ .venv/bin/addzopeuser -c path/to/etc/zope.conf username password
85+
User username created.
86+
```
87+
88+
The `addzopeuser` script and `zope.conf` locations might vary based on your installations.
89+
Replace `username` and `password` with the desired values.
90+
91+
If the user already exists:
92+
93+
- No user will be created
94+
- The password will not be changed
95+
96+
The command will return a message like this:
97+
98+
```bash
99+
$ .venv/bin/addzopeuser -c tmp/zeoclient/etc/zope.conf foo baz
100+
Got no result back. User creation may have failed.
101+
Maybe the user already exists and nothing is done then.
102+
Or the implementation does not give info when it succeeds.
103+
```

docs/admin-guide/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ install-pip
3030
3131
run-plone
3232
add-site
33+
add-emergency-user
3334
configure-zope
3435
add-ons
3536
export-import

docs/backend/users-groups.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": ""
5+
"property=og:description": ""
6+
"property=og:title": ""
7+
"keywords": ""
8+
---
9+
10+
(backend-users-groups-label)=
11+
12+
# Users and Groups
13+

docs/backend/users-groups/emergency-user.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

docs/backend/users-groups/index.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)