Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / newgrp.1.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!--
3    Copyright (c) 1991       , Julianne Frances Haugh
4    Copyright (c) 2007 - 2008, Nicolas François
5    All rights reserved.
6   
7    Redistribution and use in source and binary forms, with or without
8    modification, are permitted provided that the following conditions
9    are met:
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.
18   
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.
30 -->
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">
34 ]>
35 <refentry id='newgrp.1'>
36   <!-- $Id: newgrp.1.xml 3005 2009-05-25 19:41:43Z nekral-guest $ -->
37   <refmeta>
38     <refentrytitle>newgrp</refentrytitle>
39     <manvolnum>1</manvolnum>
40     <refmiscinfo class="sectdesc">User Commands</refmiscinfo>
41   </refmeta>
42   <refnamediv id='name'>
43     <refname>newgrp</refname>
44     <refpurpose>log in to a new group</refpurpose>
45   </refnamediv>
46   <!-- body begins here -->
47   <refsynopsisdiv id='synopsis'>
48     <cmdsynopsis>
49       <command>newgrp</command>    <arg choice='opt'>- </arg>
50       <arg choice='opt'><replaceable>group</replaceable></arg>
51     </cmdsynopsis>
52   </refsynopsisdiv>
53
54   <refsect1 id='description'>
55   <title>DESCRIPTION</title>
56     <para>
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.
62     </para>
63
64     <para>
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.
76     </para>
77
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.
83     </para>
84   </refsect1>
85
86   <refsect1 id='configuration'>
87     <title>CONFIGURATION</title>
88     <para>
89       The following configuration variables in
90       <filename>/etc/login.defs</filename> change the behavior of this
91       tool:
92     </para>
93     <variablelist>
94       &SYSLOG_SG_ENAB;
95     </variablelist>
96   </refsect1>
97
98   <refsect1 id='files'>
99     <title>FILES</title>
100     <variablelist>
101       <varlistentry>
102         <term><filename>/etc/passwd</filename></term>
103         <listitem>
104           <para>User account information.</para>
105         </listitem>
106       </varlistentry>
107       <varlistentry>
108         <term><filename>/etc/shadow</filename></term>
109         <listitem>
110           <para>Secure user account information.</para>
111         </listitem>
112       </varlistentry>
113       <varlistentry>
114         <term><filename>/etc/group</filename></term>
115         <listitem>
116           <para>Group account information.</para>
117          </listitem>
118       </varlistentry>
119       <varlistentry condition="gshadow">
120         <term><filename>/etc/gshadow</filename></term>
121         <listitem>
122           <para>Secure group account information.</para>
123         </listitem>
124       </varlistentry>
125     </variablelist>
126   </refsect1>
127
128   <refsect1 id='see_also'>
129     <title>SEE ALSO</title>
130     <para>
131       <citerefentry>
132         <refentrytitle>id</refentrytitle><manvolnum>1</manvolnum>
133       </citerefentry>,
134       <citerefentry>
135         <refentrytitle>login</refentrytitle><manvolnum>1</manvolnum>
136       </citerefentry>,
137       <citerefentry>
138         <refentrytitle>su</refentrytitle><manvolnum>1</manvolnum>
139       </citerefentry>,
140       <citerefentry>
141         <refentrytitle>sg</refentrytitle><manvolnum>1</manvolnum>
142       </citerefentry>,
143       <citerefentry>
144         <refentrytitle>gpasswd</refentrytitle><manvolnum>1</manvolnum>
145       </citerefentry>,
146       <citerefentry>
147         <refentrytitle>group</refentrytitle><manvolnum>5</manvolnum>
148       </citerefentry><phrase condition="gshadow">,
149         <citerefentry condition="gshadow">
150           <refentrytitle>gshadow</refentrytitle><manvolnum>5</manvolnum>
151         </citerefentry>
152       </phrase>.
153     </para>
154   </refsect1>
155 </refentry>