Files
shadow/docs/man/usermod.8.md
T
Pierre Warnier 81d0e1776d docs/fixes: man pages, benchmarks, BSD research, Copilot findings
Fixes #56 — 14 man pages in docs/man/ (markdown format).
Fixes #67 — 8 Copilot findings fixed:
  - useradd: proper date validation (Feb 31 rejected)
  - userdel/usermod: --root wired to SysRoot
  - usermod: --expiredate validates input
  - usermod: --login validates name + updates shadow/group
  - userdel: -f separated from -r behavior
  - useradd: home dir resolved through SysRoot
  - skel: preserves directory permissions
Fixes #69 — benchmark script (benches/benchmark.sh)
Fixes #70 — FreeBSD/NetBSD reference (docs/FREEBSD-NETBSD-REFERENCE.md)

456 tests, zero clippy warnings.
2026-03-24 13:05:40 +01:00

1.9 KiB

usermod(8) - modify a user account

NAME

usermod - modify a user account

SYNOPSIS

usermod [options] LOGIN

DESCRIPTION

The usermod command modifies the system account files to reflect the changes that are specified on the command line.

OPTIONS

-a, --append
Append the user to the supplementary group(s) specified by -G. Use only with the -G option.
-c, --comment COMMENT
Set the new value of the user's GECOS field.
-d, --home HOME_DIR
Set the new home directory for the user.
-e, --expiredate EXPIRE_DATE
Set the account expiration date.
-f, --inactive INACTIVE
Set the password inactive period.
-g, --gid GROUP
Set the new primary group ID (numeric).
-G, --groups GROUPS
Set the list of supplementary groups (comma-separated). If the -a option is not used, the user is removed from all groups not listed.
-l, --login NEW_LOGIN
Change the user's login name.
-L, --lock
Lock the user's password by prepending a '!' to the shadow password.
-P, --prefix PREFIX_DIR
Use PREFIX_DIR as a prefix for system file paths.
-R, --root CHROOT_DIR
Apply changes in the CHROOT_DIR directory.
-s, --shell SHELL
Set the new login shell.
-u, --uid UID
Set the new numeric user ID.
-U, --unlock
Unlock the user's password by removing the '!' prefix from the shadow password.

EXIT STATUS

0
Success.
1
Cannot update password file.
2
Invalid command syntax.
4
UID already in use.
6
User does not exist.

FILES

/etc/passwd
User account information.
/etc/shadow
Secure user account information.
/etc/group
Group account information.

SEE ALSO

useradd(8), userdel(8), groupmod(8), passwd(1)