2007-10-07 17:15:14 +05:30
|
|
|
.\"$Id: newgrp.1,v 1.12 2002/03/09 19:22:30 ankry Exp $
|
2007-10-07 17:14:44 +05:30
|
|
|
.\" Copyright 1991, Julianne Frances Haugh
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. Neither the name of Julianne F. Haugh nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.TH NEWGRP 1
|
|
|
|
.SH NAME
|
2007-10-07 17:15:14 +05:30
|
|
|
newgrp \- log in to a new group
|
2007-10-07 17:14:44 +05:30
|
|
|
.br
|
2007-10-07 17:15:14 +05:30
|
|
|
sg \- execute command as different group ID
|
2007-10-07 17:14:44 +05:30
|
|
|
.SH SYNOPSIS
|
2007-10-07 17:14:51 +05:30
|
|
|
\fBnewgrp\fR [\fB-\fR] [\fIgroup\fR]
|
2007-10-07 17:14:44 +05:30
|
|
|
.br
|
2007-10-07 17:15:14 +05:30
|
|
|
\fBsg\fR [\fB-\fR] [\fIgroup\fR [[\fB-c\fR] \fIcommand\fR]]
|
2007-10-07 17:14:44 +05:30
|
|
|
.SH DESCRIPTION
|
2007-10-07 17:14:51 +05:30
|
|
|
\fBnewgrp\fR is used to change the current group ID during a login session.
|
2007-10-07 17:14:44 +05:30
|
|
|
If the optional \fB\-\fR flag is given, the user's environment
|
|
|
|
will be reinitialized as though the user had logged in, otherwise
|
|
|
|
the current environment, including current working directory,
|
|
|
|
remains unchanged.
|
|
|
|
.PP
|
2007-10-07 17:14:51 +05:30
|
|
|
\fBnewgrp\fR changes the current real group ID to the named group, or to the
|
|
|
|
default group listed in \fI/etc/passwd\fR if no group name is given. The
|
2007-10-07 17:15:14 +05:30
|
|
|
user will be prompted for a password if she do not have a password and the
|
2007-10-07 17:14:51 +05:30
|
|
|
group does, or if the user is not listed as a member and the group has a
|
|
|
|
password. The user will be denied access if the group password is empty and
|
|
|
|
the user is not listed as a member.
|
2007-10-07 17:14:44 +05:30
|
|
|
.PP
|
2007-10-07 17:15:14 +05:30
|
|
|
The \fBsg\fR command works similiar to \fBnewgrp\fR but accepts a command.
|
|
|
|
The command will be executed with the Bourne shell. With most shells you
|
|
|
|
may run \fBsg\fR from, you need to enclose multi-word commands in quotes.
|
|
|
|
Another difference between \fBnewgrp\fR and \fBsg\fR is that some shells
|
|
|
|
treat \fBnewgrp\fR specially, replacing themselves with a new instance of
|
|
|
|
a shell that \fBnewgrp\fR creates. This doesn't happen with \fBsg\fR, so
|
|
|
|
upon exit from a \fBsg\fR command you are returned to your previous group ID.
|
2007-10-07 17:14:44 +05:30
|
|
|
.SH FILES
|
|
|
|
/etc/passwd \- user account information
|
|
|
|
.br
|
|
|
|
/etc/group \- group information
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR id (1),
|
2007-10-07 17:15:14 +05:30
|
|
|
.BR login (1),
|
2007-10-07 17:14:44 +05:30
|
|
|
.BR su (1)
|
|
|
|
.SH AUTHOR
|
2007-10-07 17:15:14 +05:30
|
|
|
Julianne Frances Haugh <jockgrrl@ix.netcom.com>
|