Account Considerations
Information to Plan Before Creating a User : Username, UID, Primary group, Supplementary groups, Home directory, Skeleton directory, Shell, Comment (GECOS)
| Category | Key Points | Example Command |
|---|---|---|
| Username | Required for useraddFirst char: _ or a–zMax: 32 (≤16 recommended) Allowed: letters, numbers, -, _Last char: not -Must be unique |
useradd jane |
| User Identifier (UID) | Auto-increment by default Set manually with -uRecommended max: 60000 root UID = 0System: 1–999 Regular users: ≥1000 |
useradd -u 1000 jane |

| Group Type | Description | Command |
|---|---|---|
| Primary Group | Default group if not specified UPG: group auto-created Non-UPG: usually users (GID 100)Set with -g |
useradd -g users jane |
| Supplementary Groups | Extra group memberships Comma-separated list Set with -G |
useradd -G sales,research jane |

| Item | Description | Command |
|---|---|---|
| Home Directory | Default: /home/usernameCreated automatically if enabled Controlled by /etc/default/useradd and /etc/login.defsOptions : -m create home-M do not create home-b set base directory-d set full path |
useradd -m janeuseradd -mb /test janeuseradd -md /test/jane jane |
| Skeleton Directory | Default: /etc/skelFiles copied to home -k set custom skeletonRequires -m |
useradd -mk /home/sysadmin jane |

| Item | Description | Command |
|---|---|---|
| Shell | Default from /etc/default/useraddOverride with -sSystem accounts often use /sbin/nologin |
useradd -s /bin/bash jane |
| Comment (GECOS) | Usually full name Shown by login managers Set with -c |
useradd -c "Jane Doe" jane |