Merge branch 'vendor/OPENSSL'
[dragonfly.git] / usr.bin / newgrp / newgrp.1
1 .\" Copyright (c) 2002 Tim J. Robbins.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: src/usr.bin/newgrp/newgrp.1,v 1.2 2002/05/30 13:57:35 ru Exp $
26 .\" $DragonFly: src/usr.bin/newgrp/newgrp.1,v 1.1 2004/11/23 16:26:04 liamfoy Exp $
27 .\"
28 .Dd November 24, 2013
29 .Dt NEWGRP 1
30 .Os
31 .Sh NAME
32 .Nm newgrp
33 .Nd change to a new group
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl l
37 .Op Ar group
38 .Sh DESCRIPTION
39 The
40 .Nm
41 utility creates a new shell execution environment with modified
42 real and effective group IDs.
43 .Pp
44 The options are as follows:
45 .Bl -tag -width indent
46 .It Fl l
47 Simulate a full login.
48 The environment and umask are set to what would be expected if the user
49 actually logged in again.
50 .El
51 .Pp
52 If the
53 .Ar group
54 operand is present, a new shell is started with the specified effective
55 and real group IDs.
56 The user will be prompted for a password if they are not a member of the
57 specified group.
58 .Pp
59 Otherwise, the real, effective and supplementary group IDs are restored to
60 those from the current user's password database entry.
61 .Sh DIAGNOSTICS
62 The
63 .Nm
64 utility attempts to start the shell regardless of whether group IDs
65 were successfully changed.
66 .Pp
67 If an error occurs and the shell cannot be started,
68 .Nm
69 exits >0.
70 Otherwise, the exit status of
71 .Nm
72 is the exit status of the shell.
73 .Sh SEE ALSO
74 .Xr csh 1 ,
75 .Xr groups 1 ,
76 .Xr login 1 ,
77 .Xr sh 1 ,
78 .Xr su 1 ,
79 .Xr umask 1 ,
80 .Xr group 5 ,
81 .Xr passwd 5 ,
82 .Xr environ 7
83 .Sh STANDARDS
84 The
85 .Nm
86 utility conforms to
87 .St -p1003.1-2001 .
88 .Sh HISTORY
89 A
90 .Nm
91 utility appeared in
92 .At v6 .
93 .Sh BUGS
94 For security reasons, the
95 .Nm
96 utility is normally installed without the setuid bit.
97 To enable it, run the following command:
98 .Bd -literal -offset indent
99 chmod u+s /usr/bin/newgrp
100 .Ed
101 .Pp
102 Group passwords are inherently insecure as there is no way to stop
103 users obtaining the password hash from the group database.
104 Their use is discouraged.
105 Instead, users should simply be added to the necessary groups.