man-pages/man1/sg.1.html
2021-03-31 01:06:50 +01:00

143 lines
2.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SG</TITLE>
</HEAD><BODY>
<H1>SG</H1>
Section: User Commands (1)<BR>Updated: 05/28/2020<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sg - execute command as different group ID
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<DL COMPACT>
<DT id="1">
<B>sg</B> [-] [group&nbsp;[-c&nbsp;]&nbsp;command]
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<DD>The
<B>sg</B>
command works similar to
<B>newgrp</B>
but accepts a command. The command will be executed with the
/bin/sh
shell. With most shells you may run
<B>sg</B>
from, you need to enclose multi-word commands in quotes. Another difference between
<B>newgrp</B>
and
<B>sg</B>
is that some shells treat
<B>newgrp</B>
specially, replacing themselves with a new instance of a shell that
<B>newgrp</B>
creates. This doesn't happen with
<B>sg</B>, so upon exit from a
<B>sg</B>
command you are returned to your previous group ID.
<A NAME="lbAE">&nbsp;</A>
<H2>CONFIGURATION</H2>
<P>
The following configuration variables in
/etc/login.defs
change the behavior of this tool:
<P>
<B>SYSLOG_SG_ENAB</B> (boolean)
<DL COMPACT><DT id="2"><DD>
Enable &quot;syslog&quot; logging of
<B>sg</B>
activity.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>FILES</H2>
<P>
/etc/passwd
<DL COMPACT><DT id="3"><DD>
User account information.
</DL>
<P>
/etc/shadow
<DL COMPACT><DT id="4"><DD>
Secure user account information.
</DL>
<P>
/etc/group
<DL COMPACT><DT id="5"><DD>
Group account information.
</DL>
<P>
/etc/gshadow
<DL COMPACT><DT id="6"><DD>
Secure group account information.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+id">id</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+login">login</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+newgrp">newgrp</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+su">su</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+gpasswd">gpasswd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?5+group">group</A></B>(5), <B><A HREF="/cgi-bin/man/man2html?5+gshadow">gshadow</A></B>(5).
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="10"><A HREF="#lbAE">CONFIGURATION</A><DD>
<DT id="11"><A HREF="#lbAF">FILES</A><DD>
<DT id="12"><A HREF="#lbAG">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:27 GMT, March 31, 2021
</BODY>
</HTML>