Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

usermod: -r/--remove is not accepted

Closed
#368 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #370 by @jayhemnani9910 — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
linux, rust

Research direction

Start with the usermod argument parsing and group update paths; the issue does not name files or tests, so locate them from the usermod entry point. Check how -G updates memberships in /etc/group and /etc/gshadow, then compare behavior for -rG, -r alone, and -r with -a against the GNU behavior described. Done means the flag removes only the specified group memberships and invalid combinations exit with status 2.

Written by the indexing model from the issue text.

Description

GNU usermod 4.17 has -r, --remove to take the user out of only the groups given with -G. shadow-rs rejects it:

# usermod -rG daemon u1
error: unexpected argument '-r' found

exit 2, and the user stays in daemon. GNU removes u1 from daemon in /etc/group and /etc/gshadow and leaves its other groups alone. -r without -G and -r with -a are usage errors there (exit 2).

I have a change that adds the flag; happy to open a PR.

GNU shadow 4.17.4 (Ubuntu 26.04). shadow-rs main 1b2d8de.

Dominant language
Rust
Stars
17
Forks
10
Avg merge
1d 15m
Merged PRs (30d)
37

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/shadow

All issues in uutils/shadow

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.