]> granicus.if.org Git - shadow/blob - man/sg.1.xml
* man/faillog.8.xml: Minor updates.
[shadow] / man / sg.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='sg.1'>
36   <!-- $Id$ -->
37   <refmeta>
38     <refentrytitle>sg</refentrytitle>
39     <manvolnum>1</manvolnum>
40     <refmiscinfo class="sectdesc">User Commands</refmiscinfo>
41   </refmeta>
42   <refnamediv id='name'>
43     <refname>sg</refname>
44     <refpurpose>execute command as different group ID</refpurpose>
45   </refnamediv>
46   <!-- body begins here -->
47   <refsynopsisdiv id='synopsis'>
48     <cmdsynopsis>
49       <command>sg</command>
50       <arg choice='opt'>- </arg>
51       <arg choice='opt'>group
52         <arg choice='opt'>-c </arg>
53         command
54       </arg>
55     </cmdsynopsis>
56   </refsynopsisdiv>
57
58   <refsect1 id='description'>
59   <title>DESCRIPTION</title>
60     <para>
61       The <command>sg</command> command works similar to
62       <command>newgrp</command> but accepts a command. The command will be
63       executed with the <filename>/bin/sh</filename> shell. With most shells
64       you may run <command>sg</command> from, you need to enclose multi-word
65       commands in quotes. Another difference between
66       <command>newgrp</command> and <command>sg</command> is that some
67       shells treat <command>newgrp</command> specially, replacing themselves
68       with a new instance of a shell that <command>newgrp</command> creates.
69       This doesn't happen with <command>sg</command>, so upon exit from a
70       <command>sg</command> command you are returned to your previous group
71       ID.
72     </para>
73   </refsect1>
74
75   <refsect1 id='configuration'>
76     <title>CONFIGURATION</title>
77     <para>
78       The following configuration variables in
79       <filename>/etc/login.defs</filename> change the behavior of this
80       tool:
81     </para>
82     <variablelist>
83       &SYSLOG_SG_ENAB;
84     </variablelist>
85   </refsect1>
86
87   <refsect1 id='files'>
88     <title>FILES</title>
89     <variablelist>
90       <varlistentry>
91         <term><filename>/etc/passwd</filename></term>
92         <listitem>
93           <para>User account information.</para>
94         </listitem>
95       </varlistentry>
96       <varlistentry>
97         <term><filename>/etc/shadow</filename></term>
98         <listitem>
99           <para>Secure user account information.</para>
100         </listitem>
101       </varlistentry>
102       <varlistentry>
103         <term><filename>/etc/group</filename></term>
104         <listitem>
105           <para>Group account information.</para>
106          </listitem>
107       </varlistentry>
108       <varlistentry condition="gshadow">
109         <term><filename>/etc/gshadow</filename></term>
110         <listitem>
111           <para>Secure group account information.</para>
112         </listitem>
113       </varlistentry>
114     </variablelist>
115   </refsect1>
116
117   <refsect1 id='see_also'>
118     <title>SEE ALSO</title>
119     <para>
120       <citerefentry>
121         <refentrytitle>id</refentrytitle><manvolnum>1</manvolnum>
122       </citerefentry>,
123       <citerefentry>
124         <refentrytitle>login</refentrytitle><manvolnum>1</manvolnum>
125       </citerefentry>,
126       <citerefentry>
127         <refentrytitle>newgrp</refentrytitle><manvolnum>1</manvolnum>
128       </citerefentry>,
129       <citerefentry>
130         <refentrytitle>su</refentrytitle><manvolnum>1</manvolnum>
131       </citerefentry>,
132       <citerefentry>
133         <refentrytitle>gpasswd</refentrytitle><manvolnum>1</manvolnum>
134       </citerefentry>,
135       <citerefentry>
136         <refentrytitle>group</refentrytitle><manvolnum>5</manvolnum>
137       </citerefentry>,
138       <citerefentry condition="gshadow">
139         <refentrytitle>gshadow</refentrytitle><manvolnum>5</manvolnum>
140       </citerefentry>
141     </para>
142   </refsect1>
143 </refentry>