From 3ae971374fb0d60a571358d34b57bb39b7666b62 Mon Sep 17 00:00:00 2001 From: Fabrice Quenneville Date: Tue, 29 Oct 2024 17:35:58 -0400 Subject: [PATCH] feat: add user creation notes to linux.md - Documented user addition using the `adduser` command with the `--gecos` option for pre-filling user details. --- notes/linux.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/notes/linux.md b/notes/linux.md index 11b1e09..2a24c7b 100644 --- a/notes/linux.md +++ b/notes/linux.md @@ -76,6 +76,20 @@ This command will display the number of lines in the specified file. ### User Information +**Add users** + +This variation of the adduser command uses the --gecos option to pre-fill the user's information (Full name, Room number, Work Phone, Home Phone, and Email) non-interactively, allowing you to automate user creation with predefined details. + +```bash +adduser --gecos "Fabrice Quenneville,,,fabrice@fabq.ca" fabrice +``` + +This variation of the adduser command creates a system user named "aptly" with a Bash shell, no password login (--disabled-password), a specified home directory (/home/aptly), and adds the user to a new group, while using the --gecos option to set the full name as "Aptly repository". + +```bash +adduser --system --shell /bin/bash --gecos 'Aptly repository' --group --disabled-password --home /home/aptly aptly +``` + **List Users** To list all users from the `/etc/passwd` file, use: