Skip to content
Snippets Groups Projects
Commit 718f2c9a authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

improve add user section

parent 1e560236
No related branches found
No related tags found
No related merge requests found
Pipeline #87653 passed
......@@ -142,9 +142,28 @@ User and Group management
Create a new user
-----------------
The command is `useradd` and the syntax is `useradd [options] username`
.. code-block:: shell
sudo useradd -u <UID> -g <primary group> -G <group1,group2,...> -m --shell /bin/bash <username>
will create a user with
* a specific uid `-u`
* a specific primary group `-g`
* belonging to the secondary groups `-G` (groups are separated by comma without space surrounding comma)
* create a home directory `-m` (/home/<username>)
* with a specific shell `--shell`
But if you can let the system choose the uid, primary group, ...
So the command line could be simpler.
.. code-block:: shell
sudo useradd -u UID -g <primary group> -G <group1,group2,...> -m --shell /bin/bash
sudo useradd -m --shell /bin/bash <username>
Will create a user with a home and bash as shell
Only root can perform this command.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment