newgrp(1) — Commands
OSF
NAME
newgrp − Changes primary group identification of a shell process
SYNOPSIS
newgrp [-] [group]
DESCRIPTION
The newgrp command changes the primary group identification of the current shell process to group. You remain logged in and the current directory is unchanged, but calculations of access permissions to files are performed with respect to the primary group ID.
If you specify -, newgrp changes the login environment to that of the new group. If you do not specify group, newgrp changes the group identification back to that specified for the current user in the /etc/passwd file. Only exported environment variables retain their values after you invoke newgrp. Otherwise, variables with a default value are reset to that default.
newgrp recognizes group names only; it does not recognize group ID numbers.
If a password is required for the specified group, and you are not listed as a member of that group in the group database, you are prompted to enter the correct password for that group. If you are listed as a member of that group, no password is requested. If no password is required for the specified group, only users listed as members of that group can change to that group.
Only a user with superuser authority can change the primary group of the shell to one to which that user does not belong.
Any active user-generated shell is terminated when the newgrp command is used.
NOTES
1.newgrp is also a built-in command for csh.
2.There is no convenient way to enter a password into the group database. Use of group passwords is not encouraged, because by their very nature they encourage poor security practices.