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">
38 <refentrytitle>sg</refentrytitle>
39 <manvolnum>1</manvolnum>
40 <refmiscinfo class="sectdesc">User Commands</refmiscinfo>
42 <refnamediv id='name'>
44 <refpurpose>execute command as different group ID</refpurpose>
46 <!-- body begins here -->
47 <refsynopsisdiv id='synopsis'>
50 <arg choice='opt'>- </arg>
51 <arg choice='opt'>group
52 <arg choice='opt'>-c </arg>
58 <refsect1 id='description'>
59 <title>DESCRIPTION</title>
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
75 <refsect1 id='configuration'>
76 <title>CONFIGURATION</title>
78 The following configuration variables in
79 <filename>/etc/login.defs</filename> change the behavior of this
91 <term><filename>/etc/passwd</filename></term>
93 <para>User account information.</para>
97 <term><filename>/etc/shadow</filename></term>
99 <para>Secure user account information.</para>
103 <term><filename>/etc/group</filename></term>
105 <para>Group account information.</para>
108 <varlistentry condition="gshadow">
109 <term><filename>/etc/gshadow</filename></term>
111 <para>Secure group account information.</para>
117 <refsect1 id='see_also'>
118 <title>SEE ALSO</title>
121 <refentrytitle>id</refentrytitle><manvolnum>1</manvolnum>
124 <refentrytitle>login</refentrytitle><manvolnum>1</manvolnum>
127 <refentrytitle>newgrp</refentrytitle><manvolnum>1</manvolnum>
130 <refentrytitle>su</refentrytitle><manvolnum>1</manvolnum>
133 <refentrytitle>gpasswd</refentrytitle><manvolnum>1</manvolnum>
136 <refentrytitle>group</refentrytitle><manvolnum>5</manvolnum>
138 <citerefentry condition="gshadow">
139 <refentrytitle>gshadow</refentrytitle><manvolnum>5</manvolnum>