1*5c007436SBen Gras.\" $NetBSD: newgrp.1,v 1.4 2010/05/14 17:28:23 joerg Exp $ 2*5c007436SBen Gras.\" 3*5c007436SBen Gras.\" Copyright (c) 2007, The NetBSD Foundation. 4*5c007436SBen Gras.\" All Rights Reserved. 5*5c007436SBen Gras.\" 6*5c007436SBen Gras.\" This code is derived from software contributed to The NetBSD Foundation 7*5c007436SBen Gras.\" by Brian Ginsbach. 8*5c007436SBen Gras.\" 9*5c007436SBen Gras.\" Redistribution and use in source and binary forms, with or without 10*5c007436SBen Gras.\" modification, are permitted provided that the following conditions 11*5c007436SBen Gras.\" are met: 12*5c007436SBen Gras.\" 1. Redistributions of source code must retain the above copyright 13*5c007436SBen Gras.\" notice, this list of conditions and the following disclaimer. 14*5c007436SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 15*5c007436SBen Gras.\" notice, this list of conditions and the following disclaimer in the 16*5c007436SBen Gras.\" documentation and/or other materials provided with the distribution. 17*5c007436SBen Gras.\" 18*5c007436SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19*5c007436SBen Gras.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20*5c007436SBen Gras.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21*5c007436SBen Gras.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22*5c007436SBen Gras.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23*5c007436SBen Gras.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24*5c007436SBen Gras.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25*5c007436SBen Gras.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26*5c007436SBen Gras.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27*5c007436SBen Gras.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28*5c007436SBen Gras.\" POSSIBILITY OF SUCH DAMAGE. 29*5c007436SBen Gras.\" 30*5c007436SBen Gras.Dd June 6, 2007 31*5c007436SBen Gras.Dt NEWGRP 1 32*5c007436SBen Gras.Os 33*5c007436SBen Gras.Sh NAME 34*5c007436SBen Gras.Nm newgrp 35*5c007436SBen Gras.Nd change to a new primary group 36*5c007436SBen Gras.Sh SYNOPSIS 37*5c007436SBen Gras.Nm 38*5c007436SBen Gras.Op Fl l 39*5c007436SBen Gras.Op Ar group 40*5c007436SBen Gras.Sh DESCRIPTION 41*5c007436SBen GrasThe 42*5c007436SBen Gras.Nm 43*5c007436SBen Grascommand changes a user to a new primary group 44*5c007436SBen Gras.Pq real and effective group ID 45*5c007436SBen Grasby starting a new shell. 46*5c007436SBen GrasThe user remains logged in and the current directory 47*5c007436SBen Grasand file creation mask remain unchanged. 48*5c007436SBen GrasThe user is always given a new shell even if 49*5c007436SBen Grasthe primary group change fails. 50*5c007436SBen Gras.Pp 51*5c007436SBen GrasThe 52*5c007436SBen Gras.Nm 53*5c007436SBen Grascommand accepts the following options: 54*5c007436SBen Gras.Bl -tag -width indent 55*5c007436SBen Gras.It Fl l 56*5c007436SBen GrasThe environment is changed to what would be expected if the user 57*5c007436SBen Grasactually logged in again. 58*5c007436SBen GrasThis simulates a full login. 59*5c007436SBen Gras.El 60*5c007436SBen Gras.Pp 61*5c007436SBen GrasThe 62*5c007436SBen Gras.Ar group 63*5c007436SBen Grasis a group name or non-negative numeric group ID from the group database. 64*5c007436SBen GrasThe real and effective group IDs are set to 65*5c007436SBen Gras.Ar group 66*5c007436SBen Grasor the group ID associated with the group name. 67*5c007436SBen Gras.Pp 68*5c007436SBen GrasIf 69*5c007436SBen Gras.Ar group 70*5c007436SBen Grasis not specified, 71*5c007436SBen Gras.Nm 72*5c007436SBen Grasrestores the user's real and effective group IDs to the user's 73*5c007436SBen Grasprimary group specified in the password database. 74*5c007436SBen GrasThe user's supplementary group IDs are restored to the set specified 75*5c007436SBen Grasfor the user in the group database. 76*5c007436SBen Gras.Pp 77*5c007436SBen GrasIf the user is not a member of the specified group, and the group 78*5c007436SBen Grasrequires a password, the user will be prompted for the group password. 79*5c007436SBen Gras.Sh FILES 80*5c007436SBen Gras.Bl -tag -width /etc/master.passwd -compact 81*5c007436SBen Gras.It Pa /etc/group 82*5c007436SBen GrasThe group database 83*5c007436SBen Gras.It Pa /etc/master.passwd 84*5c007436SBen GrasThe user database 85*5c007436SBen Gras.It Pa /etc/passwd 86*5c007436SBen GrasA Version 7 format password file 87*5c007436SBen Gras.El 88*5c007436SBen Gras.Sh EXIT STATUS 89*5c007436SBen GrasIf a new shell is started the exit status is the exit status of the shell. 90*5c007436SBen GrasOtherwise the exit status will be \*[Gt]0. 91*5c007436SBen Gras.Sh SEE ALSO 92*5c007436SBen Gras.Xr csh 1 , 93*5c007436SBen Gras.Xr groups 1 , 94*5c007436SBen Gras.Xr login 1 , 95*5c007436SBen Gras.Xr sh 1 , 96*5c007436SBen Gras.Xr su 1 , 97*5c007436SBen Gras.Xr umask 2 , 98*5c007436SBen Gras.Xr group 5 , 99*5c007436SBen Gras.Xr passwd 5 , 100*5c007436SBen Gras.Xr environ 7 101*5c007436SBen Gras.Sh STANDARDS 102*5c007436SBen GrasThe 103*5c007436SBen Gras.Nm 104*5c007436SBen Grascommand conforms to 105*5c007436SBen Gras.St -p1003.1-2001 . 106*5c007436SBen Gras.Sh HISTORY 107*5c007436SBen GrasA 108*5c007436SBen Gras.Nm 109*5c007436SBen Grascommand appeared in 110*5c007436SBen Gras.At v6 . 111*5c007436SBen GrasA 112*5c007436SBen Gras.Nm 113*5c007436SBen Grascommand appeared in 114*5c007436SBen Gras.Nx 5.0 . 115*5c007436SBen Gras.Sh BUGS 116*5c007436SBen GrasThere is no convenient way to enter a password into 117*5c007436SBen Gras.Pa /etc/group . 118*5c007436SBen GrasThe use of group passwords is strongly discouraged 119*5c007436SBen Grassince they are inherently insecure. 120*5c007436SBen GrasIt is not possible to stop users from obtaining the encrypted 121*5c007436SBen Graspassword from the group database. 122