old-www/LDP/solrhe/Securing-Optimizing-Linux-R.../chap5sec34.html

269 lines
4.8 KiB
HTML

<HTML
><HEAD
><TITLE
>Disable console program access</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.60"><LINK
REL="HOME"
TITLE="Securing and Optimizing Linux"
HREF="index.html"><LINK
REL="UP"
TITLE="General System Security"
HREF="gen-syssecured.html"><LINK
REL="PREVIOUS"
TITLE="The /etc/exports file"
HREF="chap5sec33.html"><LINK
REL="NEXT"
TITLE="Disable all console access"
HREF="chap5sec35.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Securing and Optimizing Linux: RedHat Edition -A Hands on Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="chap5sec33.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 5. General System Security</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="chap5sec35.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="p2ch1sct16"
>5.6. Disable console program access</A
></H1
><P
>&#13; In a safe environment where we are sure that console is secured because passwords for BIOS and LILO are set and all physical power and reset switches on the system are disabled it may be advantageous to entirely disable all
console-equivalent access to programs like shutdown, reboot, and halt for regular users on your server.
To do this, run the following command:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13; [root@deep] /#<B
CLASS="command"
>rm</B
> -f /etc/security/console.apps/&#60;servicename&#62;
</PRE
></TD
></TR
></TABLE
>
Where &#60;servicename&#62; is the name of the program to which you wish to disable console-equivalent access. Unless you use xdm, however, be careful not to remove the xserver file or no one but root will be able to start the <TT
CLASS="literal"
>X server</TT
>.
If you always use xdm to start the <TT
CLASS="literal"
>X server</TT
>, root is the only user that needs to start X, in which case you might actually want to remove the xserver file.
</P
><DIV
CLASS="example"
><A
NAME="AEN3307"
></A
><P
><B
>Example 5-2. Disable console-equivalent access</B
></P
><P
>&#13; <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>
[root@deep] /# <B
CLASS="command"
>rm</B
> -f /etc/security/console.apps/halt
[root@deep] /# <B
CLASS="command"
>rm</B
> -f /etc/security/console.apps/poweroff
[root@deep] /# <B
CLASS="command"
>rm</B
> -f /etc/security/console.apps/reboot
[root@deep] /# <B
CLASS="command"
>rm</B
> -f /etc/security/console.apps/shutdown
[root@deep] /# <B
CLASS="command"
>rm</B
> -f /etc/security/console.apps/xserver <A
NAME="prt2c012sc15"
><IMG
SRC="../images/callouts/1.gif"
HSPACE="0"
VSPACE="0"
BORDER="0"
ALT="(1)"></A
>
</PRE
></TD
></TR
></TABLE
>
<DIV
CLASS="calloutlist"
><DL
COMPACT="COMPACT"
><DT
><A
HREF="chap5sec34.html#prt2c012sc15"
><IMG
SRC="../images/callouts/1.gif"
HSPACE="0"
VSPACE="0"
BORDER="0"
ALT="(1)"></A
></DT
><DD
>&#13; if removed, root will be the only user able to start <TT
CLASS="literal"
>X</TT
>.
</DD
></DL
></DIV
>
This will disable console-equivalent access to programs halt, poweroff, reboot, and shutdown. Once again, the program xserver apply only is you are installed the Xwindow interface on your system.
</P
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
><SPAN
CLASS="inlinemediaobject"
><IMG
SRC="./images/Note.gif"
ALT="Note"
></IMG
></SPAN
>: </B
>
If you are following our setup installation, the Xwindow interface is not installed on your server and all the files described above will not appear in the <TT
CLASS="filename"
>/etc/security</TT
> directory, so
can safely ignore the above steps.
</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="chap5sec33.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="chap5sec35.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The <TT
CLASS="filename"
>/etc/exports</TT
> file</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="gen-syssecured.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Disable all console access</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>