From 6ab6a75a7b35d45df03f855a31429483dbc1c288 Mon Sep 17 00:00:00 2001 From: ale-rt Date: Tue, 11 Feb 2025 15:45:54 +0100 Subject: [PATCH] How to add an emergency user --- docs/admin-guide/add-emergency-user.md | 77 ++++++++++++++++++++++++++ submodules/plone.api | 2 +- submodules/plone.restapi | 2 +- submodules/volto | 2 +- 4 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 docs/admin-guide/add-emergency-user.md diff --git a/docs/admin-guide/add-emergency-user.md b/docs/admin-guide/add-emergency-user.md new file mode 100644 index 000000000..3739fddfb --- /dev/null +++ b/docs/admin-guide/add-emergency-user.md @@ -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 ` 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. +``` diff --git a/submodules/plone.api b/submodules/plone.api index c9a35d75c..512e28fa7 160000 --- a/submodules/plone.api +++ b/submodules/plone.api @@ -1 +1 @@ -Subproject commit c9a35d75c989fec96ded09ecd91cbf037ee0402d +Subproject commit 512e28fa78a1773abe3be4ce7573f982293a8935 diff --git a/submodules/plone.restapi b/submodules/plone.restapi index bc2936800..537a0ffdf 160000 --- a/submodules/plone.restapi +++ b/submodules/plone.restapi @@ -1 +1 @@ -Subproject commit bc29368009dfc0719adab723cfddd9675a3c79ea +Subproject commit 537a0ffdf6adce6733b2cfd5407cc85e7721427c diff --git a/submodules/volto b/submodules/volto index 3330285b2..89e290c34 160000 --- a/submodules/volto +++ b/submodules/volto @@ -1 +1 @@ -Subproject commit 3330285b2c14ed7f6131d9866e760a1fa4a5a57a +Subproject commit 89e290c341c157f222bd36cd3c8b22fcd52458e9