NEWGRP(1)

NAME
newgrp - log in to a new group

SYNOPSIS
newgrp [ - ] [ group ]

DESCRIPTION

newgrp changes a user's group identification. Only the group-ID is changed; the user remains a member of all groups previously established by setgroups (see getgroups(2V)). The user remains logged in and the current directory is unchanged, but the group-ID of newly-created files will be set to the new effective group-ID (see open(2V)). The user is always given a new shell, replacing the current shell, regardless of whether newgrp terminated successfully or due to an error condition (such as an unknown group).

Exported variables retain their values after invoking newgrp; however, all unexported variables are either reset to their default value or set to null. System variables (such as HOME, LOGNAME, PATH, SHELL, TERM, and USER), unless exported by the system or explicitly exported by the user, are reset to default values. Note: the shell command export (see sh(1)) is the method to export variables, while the C shell command setenv (see csh(1)) implicitly exports its argument.

With no arguments, newgrp changes the group identification back to the group specified in the user's password file entry.

If the first argument to newgrp is a `-', the environment is changed to what would be expected if the user actually logged in again.

A password is demanded if the group has a password and the user does not, or if the group has a password and the user is not listed in /etc/group as being a member of that group.

FILES
/etc/group
    system group file
/etc/passwd
    system password file

SEE ALSO
csh(1), login(1), sh(1), su(1V), open(2V), getgroups(2V), initgroups(3), environ(5V), group(5), passwd(5)

NOTES

For consistency with login naming rules (which do not allow 8-bit file names), group identifications cannot contain 8-bit characters. See login(1) for explanations about why login is not 8-bit clean.

BUGS

There is no convenient way to enter a password into /etc/group. Use of group passwords is not encouraged, because, by their very nature, they encourage poor security practices. Group passwords may disappear in the future.