NEWGRP(1)
๐ newgrp โ log in to a new group ๐
okay so bestie, this is newgrp(1), a User Commands girly from the shadow-utils fam. she's here to swap your group mid-session and honestly? she's lowkey iconic for it. let's get into it ๐ซถ
โจ SYNOPSIS โจ
newgrp [-] [group]
๐ธ DESCRIPTION ๐ธ
so here's the vibe. newgrp changes your current group ID while you're still logged in. no logout, no drama, just a lil group glow-up mid-session. โจ
now, the optional - flag? that's the main character flag fr. if you pass it, your environment gets reinitialized โ like you just logged in fresh, brand new, born again. if you don't pass it, everything stays exactly as it was, including your current working directory. nothing moves. nothing changes. she just changes the group and minds her business. ๐
so what does she actually do?
- she changes the current real group ID to the group you named
- or, if you didn't name a group at all, to the default group listed in
/etc/passwd - and she also tries to add that group to your user groupset
now for the โจ access control moment โจ โ if you're not root, you're gonna get prompted for a password in these situations:
- you don't have a password (looked up in
/etc/shadowif you have an entry in the shadowed password file, otherwise in/etc/passwd) and the group does have one - OR you're not listed as a member and the group has a password
๐จ and heads up: if the group password is empty and you're not listed as a member, you get denied. that's it. no entry. the door is closed bestie ๐ญ
one more thing, and this is the tea ๐ โ if there's an entry for this group in /etc/gshadow, then the list of members and the password of this group come from that file. if there isn't, then the entry in /etc/group is what we're going with. iykyk.
๐ CONFIGURATION ๐
these config variables in /etc/login.defs change how this tool behaves:
SYSLOG_SG_ENAB(boolean) โ enables"syslog"logging ofsgactivity. yes she's nosy, yes she keeps receipts ๐
๐ฆ FILES ๐ฆ
/etc/passwdโ user account information ๐ค/etc/shadowโ secure user account information ๐/etc/groupโ group account information ๐ฏ/etc/gshadowโ secure group account information ๐คซ
๐ SEE ALSO ๐
id(1), login(1), su(1), sg(1), gpasswd(1), group(5), gshadow(5). go read the whole friend group, they're all connected ๐
and that's the whole page, bestie! this one's from shadow-utils 4.19.0, dated 04/29/2026. no cap, that's the whole thing. go change a group, you absolute legend ๐โจ
๐ฆ where this page comes from
- fedora 44: shadow-utils 2:4.19.0-7.fc44 ยท BSD-3-Clause AND GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms