1 .\" $NetBSD: newgrp.1,v 1.2 2007/10/17 21:07:49 christos Exp $
3 .\" Copyright (c) 2007, The NetBSD Foundation.
4 .\" All Rights Reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd change to a new primary group
43 command changes a user to a new primary group
44 .Pq real and effective group ID
45 by starting a new shell.
46 The user remains logged in and the current directory
47 and file creation mask remain unchanged.
48 The user is always given a new shell even if
49 the primary group change fails.
53 command accepts the following options:
54 .Bl -tag -width indent
56 The environment is changed to what would be expected if the user
57 actually logged in again.
58 This simulates a full login.
63 is a group name or non-negative numeric group ID from the group database.
64 The real and effective group IDs are set to
66 or the group ID associated with the group name.
72 restores the user's real and effective group IDs to the user's
73 primary group specified in the password database.
74 The user's supplementary group IDs are restored to the set specified
75 for the user in the group database.
77 If the user is not a member of the specified group, and the group
78 requires a password, the user will be prompted for the group password.
80 If a new shell is started the exit status is the exit status of the shell.
81 Otherwise the exit status will be \*[Gt]0.
83 .Bl -tag -width /etc/master.passwd -compact
86 .It Pa /etc/master.passwd
89 A Version 7 format password file
116 There is no convenient way to enter a password into
118 The use of group passwords is strongly discouraged
119 since they are inherently insecure.
120 It is not possible to stop users from obtaining the encrypted
121 password from the group database.