1 <?xml version="1.0" encoding="ISO-8859-1"?>
3 Copyright (c) 1991 , Julianne Frances Haugh
4 Copyright (c) 2007 - 2008, Nicolas François
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. The name of the copyright holders or contributors may not be used to
16 endorse or promote products derived from this software without
17 specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
32 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
33 <!ENTITY SYSLOG_SG_ENAB SYSTEM "login.defs.d/SYSLOG_SG_ENAB.xml">
35 <refentry id='newgrp.1'>
38 <refentrytitle>newgrp</refentrytitle>
39 <manvolnum>1</manvolnum>
40 <refmiscinfo class="sectdesc">User Commands</refmiscinfo>
42 <refnamediv id='name'>
43 <refname>newgrp</refname>
44 <refpurpose>log in to a new group</refpurpose>
46 <!-- body begins here -->
47 <refsynopsisdiv id='synopsis'>
49 <command>newgrp</command> <arg choice='opt'>- </arg>
50 <arg choice='opt'><replaceable>group</replaceable></arg>
54 <refsect1 id='description'>
55 <title>DESCRIPTION</title>
57 The <command>newgrp</command> command is used to change the current
58 group ID during a login session. If the optional <option>-</option>
59 flag is given, the user's environment will be reinitialized as though
60 the user had logged in, otherwise the current environment, including
61 current working directory, remains unchanged.
65 <command>newgrp</command> changes the current real group ID to the
66 named group, or to the default group listed in
67 <filename>/etc/passwd</filename> if no group name is given.
68 <command>newgrp</command> also tries to add the group to the user
69 groupset. If not root, the user will be prompted for a password if she
70 does not have a password (in <filename>/etc/shadow</filename> if this
71 user has an entry in the shadowed password file, or in
72 <filename>/etc/passwd</filename> otherwise) and the group does, or if
73 the user is not listed as a member and the group has a password. The
74 user will be denied access if the group password is empty and the user
75 is not listed as a member.
78 <para condition="gshadow">
79 If there is an entry for this group in
80 <filename>/etc/gshadow</filename>, then the list of members and the
81 password of this group will be taken from this file, otherwise, the
82 entry in <filename>/etc/group</filename> is considered.
86 <refsect1 id='configuration'>
87 <title>CONFIGURATION</title>
89 The following configuration variables in
90 <filename>/etc/login.defs</filename> change the behavior of this
102 <term><filename>/etc/passwd</filename></term>
104 <para>User account information.</para>
108 <term><filename>/etc/shadow</filename></term>
110 <para>Secure user account information.</para>
114 <term><filename>/etc/group</filename></term>
116 <para>Group account information.</para>
119 <varlistentry condition="gshadow">
120 <term><filename>/etc/gshadow</filename></term>
122 <para>Secure group account information.</para>
128 <refsect1 id='see_also'>
129 <title>SEE ALSO</title>
132 <refentrytitle>id</refentrytitle><manvolnum>1</manvolnum>
135 <refentrytitle>login</refentrytitle><manvolnum>1</manvolnum>
138 <refentrytitle>su</refentrytitle><manvolnum>1</manvolnum>
141 <refentrytitle>sg</refentrytitle><manvolnum>1</manvolnum>
144 <refentrytitle>gpasswd</refentrytitle><manvolnum>1</manvolnum>
147 <refentrytitle>group</refentrytitle><manvolnum>5</manvolnum>
148 </citerefentry><phrase condition="gshadow">,
149 <citerefentry condition="gshadow">
150 <refentrytitle>gshadow</refentrytitle><manvolnum>5</manvolnum>