Skip to content

Commit

Permalink
(SIMP-10427) Fix dsidm commands (#437)
Browse files Browse the repository at this point in the history
* Fixed
  * Added `-b "<base DN>"` to the command line in all dsidm commands

SIMP-10427 #close
  • Loading branch information
trevor-vaughan committed Aug 19, 2021
1 parent 8c9777a commit de563fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ To find your base DN, you can run the following:

.. code-block:: shell
dsidm accounts account list | head -1
dsidm accounts -b "<base DN>" account list | head -1
Assuming that our base DN is ``dc=local,dc=com``, our configuration file would
look like the following:
Expand Down
14 changes: 7 additions & 7 deletions docs/user_guide/User_Management/LDAP/389_DS/manage_groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can list all groups in the default SIMP :term:`389-DS` instance by running:

.. code-block:: shell
dsidm accounts group list
dsidm accounts -b "<base DN>" group list
If running a SIMP-generated default instance, you should see the usual ``users``
and ``administrators`` groups.
Expand All @@ -24,7 +24,7 @@ as follows:

.. code-block:: shell
dsidm accounts posixgroup create --cn alice --gidNumber 1000
dsidm accounts -b "<base DN>" posixgroup create --cn alice --gidNumber 1000
.. NOTE::

Expand All @@ -40,15 +40,15 @@ To remove our `alice` group, run the following command:

.. code-block:: shell
dsidm accounts group delete "<DN>"
dsidm accounts -b "<base DN>" group delete "<DN>"
It will prompt you to type ``Yes I am sure`` to confirm deletion.

To get the DN for the group run:

.. code-block:: shell
dsidm accounts group get alice | head -1 | cut -f2- -d' '
dsidm accounts -b "<base DN>" group get alice | head -1 | cut -f2- -d' '
Get Information about a 389-DS Group
------------------------------------
Expand All @@ -57,7 +57,7 @@ Use the following command to get information about a specific group:

.. code-block:: shell
dsidm accounts group get alice
dsidm accounts -b "<base DN>" group get alice
Add a User to a 389-DS Group
----------------------------
Expand All @@ -66,13 +66,13 @@ Use the following command to add a user to a group:

.. code-block:: shell
dsidm accounts group add_member "<DN>"
dsidm accounts -b "<base DN>" group add_member "<DN>"
You can get the DN of a user by running:

.. code-block:: shell
dsidm accounts user get <username> | head -1 | cut -f2- -d' '
dsidm accounts -b "<base DN>" user get <username> | head -1 | cut -f2- -d' '
It is important to note that, by default, referential integrity is **not**
preserved between users and groups. This means that you will need to manually
Expand Down
18 changes: 9 additions & 9 deletions docs/user_guide/User_Management/LDAP/389_DS/manage_users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can list all users in the default SIMP :term:`389-DS` instance by running:

.. code-block:: shell
dsidm accounts user list
dsidm accounts -b "<base DN>" user list
Add a User to 389-DS
--------------------
Expand All @@ -21,7 +21,7 @@ follows:

.. code-block:: shell
dsidm accounts user create --uid alice --cn "Alice User" --displayName 'Alice' \
dsidm accounts -b "<base DN>" user create --uid alice --cn "Alice User" --displayName 'Alice' \
--uidNumber 1000 --gidNumber 1000 --homeDirectory /home/alice
Remove a User from 389-DS
Expand All @@ -31,15 +31,15 @@ To remove our `alice` user, run the following command:

.. code-block:: shell
dsidm accounts user delete <DN>
dsidm accounts -b "<base DN>" user delete <DN>
It will prompt you to type ``Yes I am sure`` to confirm deletion.

To get the DN for the user run:

.. code-block:: shell
dsidm accounts user get alice | head -1 | cut -f2- -d' '
dsidm accounts -b "<base DN>" user get alice | head -1 | cut -f2- -d' '
Add a Password to a 389-DS User
-------------------------------
Expand All @@ -60,13 +60,13 @@ To be prompted for the user credentials, you can run the following:

.. code-block:: shell
dsidm accounts account reset_password "<DN>"
dsidm accounts -b "<base DN>" account reset_password "<DN>"
To obtain the ``DN`` run:

.. code-block:: shell
dsidm accounts user get alice | head -1 | cut -f2- -d' '
dsidm accounts -b "<base DN>" user get alice | head -1 | cut -f2- -d' '
Direct Reset
^^^^^^^^^^^^
Expand All @@ -83,7 +83,7 @@ Then run the following, pasting the output of the previous command into

.. code-block:: shell
dsidm accounts user modify alice add:userPassword:<GENERATED HASH>
dsidm accounts -b "<base DN>" user modify alice add:userPassword:<GENERATED HASH>
Add a SSH Public Key to a 389-DS User
Expand All @@ -93,7 +93,7 @@ You can use the following command to add a SSH key to a 389-DS user:

.. code-block:: shell
dsidm accounts user modify alice add:nsSshPublicKey:"<ssh-rsa AAA...>"
dsidm accounts -b "<base DN>" user modify alice add:nsSshPublicKey:"<ssh-rsa AAA...>"
Remove a SSH Public Key from a 389-DS User
------------------------------------------
Expand All @@ -102,4 +102,4 @@ You can use the following command to remove a SSH key from a 389-DS user:

.. code-block:: shell
dsidm accounts user modify alice delete:nsSshPublicKey:"<ssh-rsa AAA...>"
dsidm accounts -b "<base DN>" user modify alice delete:nsSshPublicKey:"<ssh-rsa AAA...>"

0 comments on commit de563fb

Please sign in to comment.