From caf225166725d7ccff1fd66cd5cbe679df3d48a6 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Thu, 12 Sep 2024 20:57:38 +0200 Subject: [PATCH 1/3] add notes to create an emergency user --- docs/backend/index.md | 2 +- docs/backend/users-groups.md | 13 ------- docs/backend/users-groups/emergency-user.md | 40 +++++++++++++++++++++ docs/backend/users-groups/index.md | 20 +++++++++++ 4 files changed, 61 insertions(+), 14 deletions(-) delete mode 100644 docs/backend/users-groups.md create mode 100644 docs/backend/users-groups/emergency-user.md create mode 100644 docs/backend/users-groups/index.md diff --git a/docs/backend/index.md b/docs/backend/index.md index 3e7dd3278..6420b3437 100644 --- a/docs/backend/index.md +++ b/docs/backend/index.md @@ -35,7 +35,7 @@ security sending-email subscribers traversal-acquisition -users-groups +users-groups/index vocabularies widgets workflows diff --git a/docs/backend/users-groups.md b/docs/backend/users-groups.md deleted file mode 100644 index 9954103d1..000000000 --- a/docs/backend/users-groups.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -myst: - html_meta: - "description": "" - "property=og:description": "" - "property=og:title": "" - "keywords": "" ---- - -(backend-users-groups-label)= - -# Users and Groups - diff --git a/docs/backend/users-groups/emergency-user.md b/docs/backend/users-groups/emergency-user.md new file mode 100644 index 000000000..d05e9ab1a --- /dev/null +++ b/docs/backend/users-groups/emergency-user.md @@ -0,0 +1,40 @@ +--- +myst: + html_meta: + "description": "Create an emergency user" + "property=og:description": "Create an emergency user" + "property=og:title": "Create an emergency user" + "keywords": "Plone, user and groups, emergency user, pip, buildout" +--- + + +(user-groups-emergency-user-label)= + +# Emergency user + +sometimes it is needed to create an emergency user. the password of admin ist lost or you have inherit a project without a proper documentation. The usecase: you will login as admin to your, but you can't. + +First of all, do the following steps not in a production environment! Shutdown your instance. + +(user-groups-emergency-user-pip-installation-label)= + +## Create an emergency user in a pip based Plone instance + +```bash +./venv/bin/addzopeuser -c instance/etc/zope.conf +``` + +start your instance and login with the created user. + +(user-groups-emergency-user-buildout-installation-label)= + +## Create an emergency user in a buildout based Plone instance + +With buildout and plone.recipe.zope2instance you can do + +```bash +bin/instance adduser +``` + +start your instance and login with the created user. + diff --git a/docs/backend/users-groups/index.md b/docs/backend/users-groups/index.md new file mode 100644 index 000000000..23c91c3fd --- /dev/null +++ b/docs/backend/users-groups/index.md @@ -0,0 +1,20 @@ +--- +myst: + html_meta: + "description": "Managing Users And Groups in Plone" + "property=og:description": "Managing Users And Groups in Plone" + "property=og:title": "Managing Users And Groups in Plone" + "keywords": "user, groups, plone" +--- + +(backend-users-groups-label)= + +# Users and Groups + + +```{toctree} +:caption: Users and Groups +:maxdepth: 2 + +emergency-user +``` \ No newline at end of file From b4273e2a46b632cd52abf1cadc1012a792ed4526 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 13 Sep 2024 02:44:58 -0700 Subject: [PATCH 2/3] Sentence-case index.md --- docs/backend/users-groups/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/backend/users-groups/index.md b/docs/backend/users-groups/index.md index 23c91c3fd..177cb7e38 100644 --- a/docs/backend/users-groups/index.md +++ b/docs/backend/users-groups/index.md @@ -1,20 +1,20 @@ --- myst: html_meta: - "description": "Managing Users And Groups in Plone" - "property=og:description": "Managing Users And Groups in Plone" - "property=og:title": "Managing Users And Groups in Plone" - "keywords": "user, groups, plone" + "description": "Managing users and groups in Plone" + "property=og:description": "Managing users and groups in Plone" + "property=og:title": "Managing users and groups in Plone" + "keywords": "user, groups, Plone" --- (backend-users-groups-label)= -# Users and Groups +# Users and groups ```{toctree} -:caption: Users and Groups +:caption: Users and groups :maxdepth: 2 emergency-user -``` \ No newline at end of file +``` From 6ca3507ef2353c69121c664c2012412adf7804aa Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 13 Sep 2024 03:03:43 -0700 Subject: [PATCH 3/3] Merge content from Plone 5 docs in https://5.docs.plone.org/manage/deploying/zope.html#adding-users-from-command-line --- docs/backend/users-groups/emergency-user.md | 48 +++++++++++++++------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/docs/backend/users-groups/emergency-user.md b/docs/backend/users-groups/emergency-user.md index d05e9ab1a..ab6fe4bb8 100644 --- a/docs/backend/users-groups/emergency-user.md +++ b/docs/backend/users-groups/emergency-user.md @@ -4,37 +4,61 @@ myst: "description": "Create an emergency user" "property=og:description": "Create an emergency user" "property=og:title": "Create an emergency user" - "keywords": "Plone, user and groups, emergency user, pip, buildout" + "keywords": "Plone, users, groups, emergency user, pip, buildout" --- - (user-groups-emergency-user-label)= # Emergency user -sometimes it is needed to create an emergency user. the password of admin ist lost or you have inherit a project without a proper documentation. The usecase: you will login as admin to your, but you can't. +An emergency user is one that you can use to regain administrative access to a Plone site. +If you lose the administrator password, or you inherit a project without proper documentation, you can create an emergency user. + +First of all, do the following steps not in a production environment! + + +(user-groups-create-an-emergency-user-label)= + +## Create an emergency user + +There are two procedures to create an emergency user, depending on how you created and manage the Plone site. +For both scenarios, the commands you run will stop the Plone site, add a new user, and start the Plone site. + +```{important} +You should always stop your Plone site before adding a new user. +``` + +```{important} +The new username must not be an existing one. +Therefore you should avoid the username `admin`, but use another arbitrary name, such as `admin2`. +``` -First of all, do the following steps not in a production environment! Shutdown your instance. (user-groups-emergency-user-pip-installation-label)= -## Create an emergency user in a pip based Plone instance +### pip based Plone instance -```bash +You can run the following shell commands to create an emergency user. + +```shell +./venv/bin/instance stop ./venv/bin/addzopeuser -c instance/etc/zope.conf +./venv/bin/instance start ``` -start your instance and login with the created user. +Now you can login with the created user. + (user-groups-emergency-user-buildout-installation-label)= -## Create an emergency user in a buildout based Plone instance +### Buildout based Plone instance -With buildout and plone.recipe.zope2instance you can do +With buildout and `plone.recipe.zope2instance`, you can run the following shell commands to create an emergency user. -```bash +```shell +bin/instance stop bin/instance adduser +bin/instance start ``` -start your instance and login with the created user. - +Now you can login with the created user.