VIPW(8)

๐Ÿ’– VIPW(8) โ€” vipw, vigr ๐Ÿ’–

ok so real talk, bestie: this is the vipw(8) page from the shadow-utils girlies, and it's also bringing vigr along for the ride. two icons, one manpage, both absolutely essential if you're messing with account files. let's get into it ๐ŸŽ€


โœจ NAME โœจ

so these two commands are vipw and vigr โ€” and what they do is edit the password, group, shadow-password or shadow-group file. that's literally the whole job, no cap ๐Ÿ’…


โœจ SYNOPSIS โœจ

okay the vibe check on syntax is super simple, look:

vipw [options]
vigr [options]

like yes, that's it, that's the whole opening move ๐Ÿฆ‹


โœจ DESCRIPTION โœจ

so here's the tea โ˜• โ€” the vipw and vigr commands edit the files /etc/passwd and /etc/group, respectively. respectively!! meaning vipw takes the passwd file and vigr takes the group file, they're not out here swapping, iykyk.

but wait, there's more ๐Ÿ’– โ€” if you hit them with the -s flag, they will edit the shadow versions of those files instead: /etc/shadow and /etc/gshadow, respectively. so -s is giving "take me to the secret file" energy and honestly? obsessed.

and bestie, this is the important part: the programs will set the appropriate locks to prevent file corruption. that's the whole reason you use these instead of just yeeting open /etc/passwd in vim like a menace. do NOT come for me in the replies if you skip the locks ๐Ÿ™ˆ

when the programs go looking for an editor, they're not picky โ€” they check in this exact order:

  1. first they try the environment variable $VISUAL
  2. then they try the environment variable $EDITOR
  3. and finally, the default editor, vi(1)

so if your editor situation is chaotic, now you know exactly who to blame ๐ŸŒธ


โœจ OPTIONS โœจ

the options which apply to the vipw and vigr commands are โ€” yes, both of them, this list is shared, we love a crossover episode ๐Ÿซถ

  • -g, --group โ€” edit the group database. group chat for your groups, basically.
  • -h, --help โ€” display the help message and exit. the "just tell me what to do" option, iconic.
  • -p, --passwd โ€” edit the passwd database. user accounts, coming right up.
  • -q, --quiet โ€” quiet mode. shhh ๐Ÿคซ no yapping.
  • -R, --root CHROOT_DIR โ€” apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. โš ๏ธ heads up though: only absolute paths are supported. do not come at this with a relative path, it will not go well for you, fr fr.
  • -s, --shadow โ€” edit the shadow or gshadow database. the secret menu โœจ

โœจ ENVIRONMENT โœจ

these two env vars are the ones calling the shots on which editor shows up:

  • VISUAL โ€” the editor to be used. main character of the editor-hunting process, gets first dibs ๐Ÿ‘‘
  • EDITOR โ€” the editor to be used if VISUAL is not set. so it's the backup dancer, but a very important backup dancer ๐Ÿ’œ

โœจ FILES โœจ

the files these bad boys are touching, in all their glory:

  • /etc/group โ€” group account information.
  • /etc/gshadow โ€” secure group account information. ๐Ÿ”’
  • /etc/passwd โ€” user account information.
  • /etc/shadow โ€” secure user account information. ๐Ÿ”’

like, look at them. four little files running the entire account system. slay ๐ŸŽ€


โœจ SEE ALSO โœจ

go read these next, bestie, they're all connected:

vi(1), group(5), gshadow(5), passwd(5), shadow(5)

(and yes, that's exactly how the original lists them โ€” I'm not about to "fix" the punctuation, that's not my business ๐Ÿ’€)


โš ๏ธ tiny reminder before you go: these commands exist specifically to set locks so your files don't get corrupted. don't skip them, don't get cute with relative paths on -R, and maybe set $VISUAL to something you actually know how to exit. ๐Ÿ’…

and that's the whole page!! this one came to you courtesy of shadow-utils 4.18.0, dated 06/24/2025 โ€” she's serving version numbers and timestamps at the very end like the legend she is ๐ŸŒˆโญ๐Ÿ’–

๐Ÿ“ฆ where this page comes from