$
Impara Manuale Linux
it
XP:0
Missione 141Group Manager
+220 XP

Modifying User Groups & Shell (usermod)

Avvia il terminale interattivo per questa missione→Nessuna installazione richiesta • Funziona nel browser

Concetto e panoramica

When onboarding engineers or automation service accounts, you must configure their supplementary group memberships and default login shells. In Linux, usermod modifies existing accounts in /etc/passwd and /etc/group.

- -aG : Appends the user to supplementary groups without removing them from existing groups. (CRITICAL: omitting -a would replace all existing secondary groups!).
- -s : Specifies the new login shell (e.g. /bin/bash or /usr/sbin/nologin).

Let's modify account permissions for deployer. Add user deployer to the sudo group using sudo usermod -aG sudo deployer, then change their login shell to bash using sudo usermod -s /bin/bash deployer.

Riferimento sintassi dei comandi

Command / SyntaxDescription
sudo usermod -aG sudo deployerAppend user deployer to administrative sudo group
sudo usermod -s /bin/bash deployerSet default shell to bash for user

Obiettivi di verifica

  • ○
    Add deployer to sudo group with usermod -aG
  • ○
    Update deployer login shell to /bin/bash

Pronto a completare la Missione 141?