<?Pub UDT _bookmark _target?><?Pub EntList bsol dash hellip gt lt minus?><?Pub CX solbook(book(title()bookinfo()part()part(title()partintro()chapter()?><chapter id="secsys-1"><?Pub Tag atict:info tracking="off" ref="0"?><?Pub Tag atict:user
user="sharonr" fullname="Sharon Veach"?><title>Controlling Access to Systems
(Tasks)</title><highlights><para>This chapter describes the procedures for controlling who can access
Solaris systems. The following is a list of the information in this chapter.</para><itemizedlist><listitem><para><olink targetptr="secsys-24" remap="internal">Controlling System Access (Task
Map)</olink></para>
</listitem><listitem><para><olink targetptr="secsys-25" remap="internal">Securing Logins and Passwords
(Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="secsys-15" remap="internal">Changing the Password Algorithm
(Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="secsys-37" remap="internal">Monitoring and Restricting Superuser
(Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="secsys-29" remap="internal">Controlling Access to System
Hardware (Task Map)</olink></para>
</listitem>
</itemizedlist><para><indexterm><primary>computer security</primary><see>system security</see></indexterm><indexterm><primary>machine security</primary><see>system security</see></indexterm><indexterm><primary>commands</primary><seealso>individual commands</seealso></indexterm>For overview information about system security, see <olink targetptr="concept-1" remap="internal">Chapter&nbsp;2, Managing Machine Security (Overview)</olink>.</para>
</highlights><sect1 id="secsys-24"><title>Controlling System Access (Task Map)</title><indexterm><primary>task maps</primary><secondary>securing systems</secondary>
</indexterm><indexterm><primary>task maps</primary><secondary>system access</secondary>
</indexterm><indexterm><primary>controlling</primary><secondary>system access</secondary>
</indexterm><para>A computer is as secure as its weakest point of entry. The following
task map shows the areas that you should monitor and secure.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="24.40*"/><colspec colname="colspec1" colwidth="41.20*"/><colspec colname="colspec2" colwidth="33.40*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Monitor, permit, and deny user login</para>
</entry><entry><para>Monitors unusual login activity. Prevents logins temporarily. Manages
dial-up logins.</para>
</entry><entry><para><olink targetptr="secsys-25" remap="internal">Securing Logins and Passwords (Task Map)</olink></para>
</entry>
</row><row><entry><para>Provide strong password encryption</para>
</entry><entry><para>Specifies algorithms to encrypt user passwords. Installs additional
algorithms.</para>
</entry><entry><para><olink targetptr="secsys-15" remap="internal">Changing the Password Algorithm (Task Map)</olink></para>
</entry>
</row><row><entry><para>Monitor and restrict superuser activities</para>
</entry><entry><para>Regularly monitors superuser activity. Prevents remote login by a <literal>root</literal> user.</para>
</entry><entry><para><olink targetptr="secsys-37" remap="internal">Monitoring and Restricting Superuser (Task
Map)</olink></para>
</entry>
</row><row><entry><para>Prevent access to hardware settings</para>
</entry><entry><para>Keeps ordinary users away from the PROM.</para>
</entry><entry><para><olink targetptr="secsys-29" remap="internal">Controlling Access to System Hardware (Task
Map)</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="secsys-25"><title>Securing Logins and Passwords (Task Map)</title><indexterm><primary>task maps</primary><secondary>securing logins and passwords</secondary>
</indexterm><indexterm><primary>logging in</primary><secondary>task map</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>task map</secondary>
</indexterm><indexterm><primary>securing</primary><secondary>logins task map</secondary>
</indexterm><indexterm><primary>securing</primary><secondary>passwords task map</secondary>
</indexterm><para>The following task map points to procedures that monitor user logins
and that disable user logins.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="24.40*"/><colspec colname="colspec1" colwidth="41.20*"/><colspec colname="colspec2" colwidth="33.40*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Display a user's login status</para>
</entry><entry><para>Lists extensive information about a user's login account, such as full
name and password aging information.</para>
</entry><entry><para><olink targetptr="secsys-28" remap="internal">How to Display a User's Login Status</olink></para>
</entry>
</row><row><entry><para>Find users who do not have passwords</para>
</entry><entry><para>Finds only those users whose accounts do not require a password.</para>
</entry><entry><para><olink targetptr="secsys-27" remap="internal">How to Display Users Without Passwords</olink></para>
</entry>
</row><row><entry><para>Disable logins temporarily</para>
</entry><entry><para>Denies user logins to a machine as part of system shutdown or routine
maintenance. </para>
</entry><entry><para><olink targetptr="secsys-31" remap="internal">How to Temporarily Disable User Logins</olink></para>
</entry>
</row><row><entry><para>Save failed login attempts</para>
</entry><entry><para>Creates a log of users who failed to provide the correct password after
five attempts.</para>
</entry><entry><para><olink targetptr="secsys-26" remap="internal">How to Monitor Failed Login Attempts</olink></para>
</entry>
</row><row><entry><para>Save all failed login attempts</para>
</entry><entry><para>Creates a log of failed attempts to log in.</para>
</entry><entry><para><olink targetptr="secsys-36" remap="internal">How to Monitor All Failed Login Attempts</olink></para>
</entry>
</row><row><entry><para>Create a dial-up password</para>
</entry><entry><para>Requires an additional password for users who log in remotely through
a modem or dial-up port.</para>
</entry><entry><para><olink targetptr="secsys-33" remap="internal">How to Create a Dial-Up Password</olink></para>
</entry>
</row><row><entry><para>Disable dial-up logins temporarily</para>
</entry><entry><para>Prevents users from dialing in remotely through a modem or port.</para>
</entry><entry><para><olink targetptr="secsys-35" remap="internal">How to Temporarily Disable Dial-Up Logins</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="secsystask-40"><title>Securing Logins and Passwords</title><para>You can limit remote logins and require users to have passwords. You
can also monitor failed access attempts and disable logins temporarily.</para><task id="secsys-28"><title>How to Display a User's Login Status</title><indexterm><primary>users</primary><secondary>displaying login status</secondary>
</indexterm><indexterm><primary>viewing</primary><secondary>user's login status</secondary>
</indexterm><indexterm><primary>displaying</primary><secondary>user's login status</secondary>
</indexterm><indexterm><primary>logging in</primary><secondary>displaying user's login status</secondary>
</indexterm><indexterm><primary><command>logins</command> command</primary><secondary>displaying user's login status</secondary>
</indexterm><indexterm><primary>system security</primary><secondary>displaying</secondary><tertiary>user's login status</tertiary>
</indexterm><indexterm><primary>user accounts</primary><secondary>displaying login status</secondary>
</indexterm><procedure>&rolePAstep;<step><para><indexterm><primary><command>logins</command> command</primary><secondary>syntax</secondary></indexterm>Display a user's login status by
using the <command>logins</command> command.</para><screen># logins -x -l <replaceable>username</replaceable></screen><variablelist><varlistentry><term><option>x</option></term><listitem><para>Displays an extended set of login status information.</para>
</listitem>
</varlistentry><varlistentry><term><option>l</option> <replaceable>username</replaceable></term><listitem><para>Displays the login status for the specified user. The variable <replaceable>username</replaceable> is a user's login name. Multiple login names must be
specified in a comma-separated list.</para>
</listitem>
</varlistentry>
</variablelist><para>The <command>logins</command> command uses the appropriate password
database to obtain a user's login status. The database can be the local <filename>/etc/passwd</filename> file, or a password database for the name service.
For more information, see the <olink targetdoc="group-refman" targetptr="logins-1m" remap="external"><citerefentry><refentrytitle>logins</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</step>
</procedure><example id="secsys-34"><title>Displaying a User's Login Status</title><indexterm><primary>displaying</primary><secondary>user's login status</secondary>
</indexterm><indexterm><primary>logging in</primary><secondary>displaying user's login status</secondary>
</indexterm><indexterm><primary><command>logins</command> command</primary><secondary>displaying user's login status</secondary>
</indexterm><indexterm><primary>system security</primary><secondary>displaying</secondary><tertiary>user's login status</tertiary>
</indexterm><indexterm><primary>user accounts</primary><secondary>displaying login status</secondary>
</indexterm><para>In the following example, the login status for the user <literal>rimmer</literal> is
displayed.</para><screen># <userinput>logins -x -l rimmer</userinput>
rimmer       500     staff           10   Annalee J. Rimmer
                     /export/home/rimmer
                     /bin/sh
                     PS 010103 10 7 -1</screen><variablelist><varlistentry><term><literal>rimmer</literal></term><listitem><para>Identifies the user's login name.</para>
</listitem>
</varlistentry><varlistentry><term><literal>500</literal></term><listitem><para>Identifies the user ID (UID).</para>
</listitem>
</varlistentry><varlistentry><term><literal>staff</literal></term><listitem><para>Identifies the user's primary group.</para>
</listitem>
</varlistentry><varlistentry><term><literal>10</literal></term><listitem><para>Identifies the group ID (GID).</para>
</listitem>
</varlistentry><varlistentry><term><literal>Annalee J. Rimmer</literal></term><listitem><para>Identifies the comment.</para>
</listitem>
</varlistentry><varlistentry><term><literal>/export/home/rimmer</literal></term><listitem><para>Identifies the user's home directory.</para>
</listitem>
</varlistentry><varlistentry><term><literal>/bin/sh</literal></term><listitem><para>Identifies the login shell.</para>
</listitem>
</varlistentry><varlistentry><term><literal>PS 010170 10 7 -1</literal></term><listitem><itemizedlist><para>Specifies the password aging information:</para><listitem><para>Last date that the password was changed</para>
</listitem><listitem><para>Number of days that are required between changes</para>
</listitem><listitem><para>Number of days before a change is required</para>
</listitem><listitem><para>Warning period</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</example>
</task><task id="secsys-27"><title>How to Display Users Without Passwords</title><indexterm><primary>users</primary><secondary>having no passwords</secondary>
</indexterm><indexterm><primary>listing</primary><secondary>users with no passwords</secondary>
</indexterm><indexterm><primary>viewing</primary><secondary>users with no passwords</secondary>
</indexterm><indexterm><primary>displaying</primary><secondary>users with no passwords</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>finding users with no passwords</secondary>
</indexterm><procedure>&rolePAstep;<step><para><indexterm><primary><option>p</option> option</primary><secondary><command>logins</command> command</secondary></indexterm>Display all users who have
no passwords by using the <command>logins</command> command.</para><screen># logins -p</screen><para><indexterm><primary><command>logins</command> command</primary><secondary>displaying users with no passwords</secondary></indexterm><indexterm><primary>passwords</primary><secondary>displaying users with no passwords</secondary></indexterm><indexterm><primary>system security</primary><secondary>displaying</secondary><tertiary>users with no passwords</tertiary></indexterm>The <option>p</option> option displays
a list of users with no passwords. The <command>logins</command> command uses
the password database from the local system unless a name service is enabled.</para>
</step>
</procedure><example id="secsys-41"><title>Displaying Users Without Passwords</title><para>In the following example, the user <command>pmorph</command> does not
have a password.</para><screen># <userinput>logins -p</userinput>
pmorph          501     other           1       Polly Morph
# </screen>
</example>
</task><task id="secsys-31"><title>How to Temporarily Disable User Logins</title><indexterm><primary>users</primary><secondary>disabling login</secondary>
</indexterm><indexterm><primary>disabling</primary><secondary>logins temporarily</secondary>
</indexterm><indexterm><primary>logging in</primary><secondary>disabling temporarily</secondary>
</indexterm><indexterm><primary><filename>/etc/nologin</filename> file</primary><secondary>disabling user logins temporarily</secondary>
</indexterm><indexterm><primary>disabling</primary><secondary>user logins</secondary>
</indexterm><tasksummary><para>Temporarily disable user logins during system shutdown or routine maintenance.
Superuser logins are not affected. For more information, see the <olink targetdoc="group-refman" targetptr="nologin-4" remap="external"><citerefentry><refentrytitle>nologin</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</tasksummary><procedure>&rolePAstep;<step><para>Create the <filename>/etc/nologin</filename> file in a text editor.</para><screen># <userinput>vi /etc/nologin</userinput></screen>
</step><step><para>Include a message about system availability.</para>
</step><step><para>Close and save the file.</para>
</step>
</procedure><example id="secsys-43"><title>Disabling User Logins</title><para>In this example, users are notified of system unavailability.</para><screen># <userinput>vi /etc/nologin</userinput>
(<replaceable>Add system message here</replaceable>)
 
# <userinput>cat /etc/nologin</userinput> 
***No logins permitted.***

***The system will be unavailable until 12 noon.***</screen><para>You can also bring the system to run level 0, single-user mode, to disable
logins. For information on bringing the system to single-user mode, see <olink targetdoc="group-sa" targetptr="hbsyshalt-84412" remap="external">Chapter 10, <citetitle remap="chapter">Shutting Down a System (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</example>
</task><task id="secsys-26"><title>How to Monitor Failed Login Attempts</title><indexterm><primary>logging in</primary><secondary>monitoring failures</secondary>
</indexterm><indexterm><primary>monitoring</primary><secondary>failed logins</secondary>
</indexterm><indexterm><primary>failed login attempts</primary><secondary><filename>loginlog</filename> file</secondary>
</indexterm><indexterm><primary>logging in</primary><secondary>security</secondary><tertiary>saving failed attempts</tertiary>
</indexterm><indexterm><primary><filename>loginlog</filename> file</primary><secondary>saving failed login attempts</secondary>
</indexterm><indexterm><primary>saving</primary><secondary>failed login attempts</secondary>
</indexterm><indexterm><primary>system security</primary><secondary>saving failed login attempts</secondary>
</indexterm><indexterm><primary><filename>/var/adm/loginlog</filename> file</primary><secondary>saving failed login attempts</secondary>
</indexterm><indexterm><primary>access</primary><secondary>security</secondary><tertiary>saving failed logins</tertiary>
</indexterm><tasksummary><para>This procedure captures failed login attempts from terminal windows.
This procedure  does not capture failed logins from a CDE or GNOME login attempt.</para>
</tasksummary><procedure>&rolePAstep;<step><para>Create the <filename>loginlog</filename> file in the <filename>/var/adm</filename> directory.</para><screen># <userinput>touch /var/adm/loginlog</userinput></screen>
</step><step><para>Set read-and-write permissions for <literal>root</literal> user
on the <filename>loginlog</filename> file.</para><screen># <userinput>chmod 600 /var/adm/loginlog</userinput></screen>
</step><step><para>Change group membership to <command>sys</command> on the <filename>loginlog</filename> file.</para><screen># <userinput>chgrp sys /var/adm/loginlog</userinput></screen>
</step><step><para>Verify that the log works.</para><para>For example, log in to
the system five times with the wrong password. Then, display the <filename>/var/adm/loginlog</filename> file.</para><screen># <userinput>more /var/adm/loginlog</userinput>
jdoe:/dev/pts/2:Tue Nov  4 10:21:10 2003
jdoe:/dev/pts/2:Tue Nov  4 10:21:21 2003
jdoe:/dev/pts/2:Tue Nov  4 10:21:30 2003
jdoe:/dev/pts/2:Tue Nov  4 10:21:40 2003
jdoe:/dev/pts/2:Tue Nov  4 10:21:49 2003
#</screen><para>The <filename>loginlog</filename> file contains one entry for each failed
attempt. Each entry contains the user's login name, tty device, and time of
the failed attempt. If a person makes fewer than five unsuccessful attempts,
no failed attempts are logged.</para><para>A growing <filename>loginlog</filename> file can indicate an attempt
to break into the computer system. Therefore, check and clear the contents
of this file regularly. For more information, see the <olink targetdoc="group-refman" targetptr="loginlog-4" remap="external"><citerefentry><refentrytitle>loginlog</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</step>
</procedure>
</task><task id="secsys-36"><title>How to Monitor All Failed Login Attempts</title><indexterm><primary>log files</primary><secondary>failed login attempts</secondary>
</indexterm><indexterm><primary>logging in</primary><secondary>log of failed logins</secondary>
</indexterm><indexterm><primary><filename>/etc/syslog.conf</filename> file</primary><secondary>failed logins and</secondary>
</indexterm><indexterm><primary>configuration files</primary><secondary><filename>syslog.conf</filename> file</secondary>
</indexterm><indexterm><primary>failed login attempts</primary><secondary><filename>syslog.conf</filename> file</secondary>
</indexterm><indexterm><primary><filename>syslog.conf</filename> file</primary><secondary>saving failed login attempts</secondary>
</indexterm><indexterm><primary><filename>/var/log/authlog</filename> file</primary><secondary>failed logins</secondary>
</indexterm><indexterm><primary><filename>authlog</filename> file</primary><secondary>saving failed login attempts</secondary>
</indexterm><tasksummary><para>This procedure captures in a <command>syslog</command> file all failed
login attempts.</para>
</tasksummary><procedure>&rolePAstep;<step><para><indexterm><primary>system variables</primary><secondary><envar>SYSLOG_FAILED_LOGINS</envar></secondary></indexterm><indexterm><primary><envar>SYSLOG_FAILED_LOGINS</envar></primary><secondary>system variable</secondary></indexterm><indexterm><primary><filename>/etc/default/login</filename> file</primary><secondary>login default settings</secondary></indexterm><indexterm><primary><filename>login</filename> file</primary><secondary>login default settings</secondary></indexterm>Set up the <filename>/etc/default/login</filename> file with the desired values for <envar>SYSLOG</envar> and <envar>SYSLOG_FAILED_LOGINS</envar></para><para>Edit the <filename>/etc/default/login</filename> file
to change the entry. Make sure that <userinput>SYSLOG=YES</userinput> is uncommented.</para><screen># <userinput>grep SYSLOG /etc/default/login</userinput>
# SYSLOG determines whether the syslog(3) LOG_AUTH facility 
# should be used
<userinput>SYSLOG=YES</userinput>
&hellip;
<userinput>SYSLOG_FAILED_LOGINS=0</userinput>
#</screen>
</step><step><para>Create a file with the correct permissions to hold the logging
information.</para><substeps><step><para>Create the <filename>authlog</filename> file in the <filename>/var/adm</filename> directory.</para><screen># <userinput>touch /var/adm/authlog</userinput></screen>
</step><step><para>Set read-and-write permissions for <literal>root</literal> user
on the <filename>authlog</filename> file.</para><screen># <userinput>chmod 600 /var/adm/authlog</userinput></screen>
</step><step><para>Change group membership to <command>sys</command> on the <filename>authlog</filename> file.</para><screen># <userinput>chgrp sys /var/adm/authlog</userinput></screen>
</step>
</substeps>
</step><step><para>Edit the <filename>syslog.conf</filename> file to log failed password
attempts.</para><para>The failures should be sent to the <filename>authlog</filename> file.</para><substeps><step><para>Type the following entry into the <filename>syslog.conf</filename> file.</para><para>Fields on the same line in <filename>syslog.conf</filename> are
separated by tabs.</para><screen>auth.notice <lineannotation>&lt;Press Tab&gt;</lineannotation>  /var/adm/authlog</screen>
</step><step><para><indexterm><primary><command>svcadm</command> command</primary><secondary>restarting <command>syslog</command> daemon</secondary></indexterm>Refresh
the configuration information for the <command>syslog</command> daemon.</para><screen># <userinput>svcadm refresh system/system-log</userinput></screen>
</step>
</substeps>
</step><step><para>Verify that the log works.</para><para>For example, as an ordinary
user, log in to the system with the wrong password. Then, in the Primary Administrator
role or as superuser, display the <filename>/var/adm/authlog</filename> file.</para><screen># <userinput>more /var/adm/authlog</userinput>
Nov  4 14:46:11 example1 login: [ID 143248 auth.notice] 
 Login failure on /dev/pts/8 from example2, stacey
#</screen>
</step><step><para>Monitor the <filename>/var/adm/authlog</filename> file on a regular
basis.</para>
</step>
</procedure><example id="secsys-47"><title>Logging Access Attempts After Three Login Failures</title><para>Follow the preceding procedure, except set the value of <envar>SYSLOG_FAILED_LOGINS</envar> to <literal>3</literal> in the <filename>/etc/default/login</filename> file.</para>
</example><example id="secsys-48"><title>Closing Connection After Three Login Failures</title><para>Uncomment the <envar>RETRIES</envar> entry in the <filename>/etc/default/login</filename> file, then set the value of <envar>RETRIES</envar> to <literal>3</literal>.
Your edits take effect immediately. After three login retries in one session,
the system closes the connection.</para>
</example>
</task><task id="secsys-33"><title>How to Create a Dial-Up Password</title><indexterm><primary>adding</primary><secondary>dial-up passwords</secondary>
</indexterm><indexterm><primary>creating</primary><secondary>dial-up passwords</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>creating for dial-up</secondary>
</indexterm><indexterm><primary>dial-up passwords</primary><secondary>creating</secondary>
</indexterm><tasksummary><caution><para>When you first establish a dial-up password, be sure to remain
logged in to at least one port. Test the password on a different port. If
you log off to test the new password, you might not be able to log back in.
If you are still logged in to another port, you can go back and fix your mistake.</para>
</caution>
</tasksummary><procedure>&rolePAstep;<step><para><indexterm><primary>configuring</primary><secondary>dial-up logins</secondary></indexterm><indexterm><primary>creating</primary><secondary>dial-up passwords</secondary></indexterm><indexterm><primary>administering</primary><secondary>dial-up logins</secondary></indexterm><indexterm><primary><filename>dialups</filename> file</primary><secondary>creating</secondary></indexterm><indexterm><primary><filename>/etc/dialups</filename> file</primary><secondary>creating</secondary></indexterm>Create an <filename>/etc/dialups</filename> file that contains
a list of serial devices.</para><para>Include all the ports that are being
protected with dial-up passwords. The <filename>/etc/dialups</filename> file
should appear similar to the following:</para><screen>/dev/term/a
/dev/term/b
/dev/term/c</screen>
</step><step><para><indexterm><primary><filename>d_passwd</filename> file</primary><secondary>creating</secondary></indexterm><indexterm><primary><filename>/etc/d_passwd</filename> file</primary><secondary>creating</secondary></indexterm><indexterm><primary>creating</primary><secondary><filename>/etc/d_passwd</filename> file</secondary></indexterm><indexterm><primary>creating</primary><secondary><filename>d_passwd</filename> file</secondary></indexterm><indexterm><primary><command>uucico</command> command</primary><secondary>login program</secondary></indexterm>Create an <filename>/etc/d_passwd</filename> file that contains the login programs that you are requiring to
have a dial-up password. </para><para>Include shell programs that a user could
be running at login, for example, <filename>uucico</filename>, <command>sh</command>, <command>ksh</command>, and <command>csh</command>. The <filename>/etc/d_passwd</filename> file
should appear similar to the following: </para><screen><filename>/usr/lib/uucp/uucico:</filename><replaceable>encrypted-password</replaceable>:
<filename>/usr/bin/csh:</filename><replaceable>encrypted-password</replaceable>:
<filename>/usr/bin/ksh:</filename><replaceable>encrypted-password</replaceable>:
<filename>/usr/bin/sh:</filename><replaceable>encrypted-password</replaceable>:</screen><para>Later in the procedure, you are going to add the encrypted password
for each login program.</para>
</step><step><para>Set ownership to <literal>root</literal> on the two files.</para><screen># chown root /etc/dialups /etc/d_passwd</screen>
</step><step><para>Set group ownership to <literal>root</literal> on the two files.</para><screen># chgrp root /etc/dialups /etc/d_passwd</screen>
</step><step><para>Set read-and-write permissions for <literal>root</literal> on
the two files.</para><screen># chmod 600 /etc/dialups /etc/d_passwd</screen>
</step><step><para><indexterm><primary>creating</primary><secondary>passwords for temporary user</secondary></indexterm>Create the encrypted passwords.</para><substeps><step><para>Create a temporary user.</para><screen># useradd <replaceable>username</replaceable></screen>
</step><step><para>Create a password for the temporary user.</para><screen># passwd <replaceable>username</replaceable>
New Password:  <lineannotation>&lt;Type password&gt;</lineannotation>
Re-enter new Password:   <lineannotation>&lt;Retype password&gt;</lineannotation>
passwd: password successfully changed for <replaceable>username</replaceable></screen>
</step><step><para>Capture the encrypted password.</para><screen># grep <replaceable>username</replaceable> /etc/shadow &gt; <replaceable>username</replaceable>.temp</screen>
</step><step><para>Edit the <replaceable>username</replaceable>.temp file.</para><para>Delete
all fields except the encrypted password. The second field holds the encrypted
password. </para><para>For example, in the following line, the encrypted password is <literal>U9gp9SyA/JlSk</literal>.</para><screen>temp:U9gp9SyA/JlSk:7967:::::7988:</screen>
</step><step><para>Delete the temporary user.</para><screen># userdel <replaceable>username</replaceable></screen>
</step>
</substeps>
</step><step><para>Copy the encrypted password from <replaceable>username</replaceable><filename>.temp</filename> file into the <filename>/etc/d_passwd</filename> file.</para><para>You can create a different password for each login shell. Alternatively,
use the same password for each login shell.</para>
</step><step><para>Inform your dial-up users of the password.</para><para>You should
ensure that your means of informing the users cannot be tampered with.</para>
</step>
</procedure>
</task><task id="secsys-35"><title>How to Temporarily Disable Dial-Up Logins</title><indexterm><primary>disabling</primary><secondary>dial-up passwords</secondary>
</indexterm><indexterm><primary>disabling</primary><secondary>dial-up logins temporarily</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>disabling dial-up temporarily</secondary>
</indexterm><indexterm><primary>dial-up passwords</primary><secondary>disabling temporarily</secondary>
</indexterm><indexterm><primary><filename>d_passwd</filename> file</primary><secondary>disabling dial-up logins temporarily</secondary>
</indexterm><indexterm><primary><filename>/etc/d_passwd</filename> file</primary><secondary sortas="etc/d_passwd file">disabling dial-up logins temporarily</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>dial-up passwords</secondary><tertiary>disabling temporarily</tertiary>
</indexterm><indexterm><primary>stopping</primary><secondary>dial-up logins temporarily</secondary>
</indexterm><indexterm><primary>system security</primary><secondary>dial-up passwords</secondary><tertiary>disabling temporarily</tertiary>
</indexterm><procedure>&rolePAstep;<step><para>Put the following single-line entry into the <filename>/etc/d_passwd</filename> file: </para><screen>/usr/bin/sh:*:</screen>
</step>
</procedure>
</task>
</sect1><sect1 id="secsys-15"><title>Changing the Password Algorithm (Task Map)</title><indexterm><primary>task maps</primary><secondary>changing default algorithm for password encryption</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>specifying algorithm</secondary><tertiary>locally</tertiary>
</indexterm><indexterm><primary>policies</primary><secondary>specifying password algorithm</secondary>
</indexterm><indexterm><primary>encrypting</primary><secondary>passwords</secondary>
</indexterm><indexterm><primary>encryption</primary><secondary>specifying password algorithm</secondary><tertiary>locally</tertiary>
</indexterm><indexterm><primary>changing</primary><secondary>default password algorithm</secondary>
</indexterm><indexterm><primary>changing</primary><secondary>password algorithm task map</secondary>
</indexterm><indexterm><primary>administering</primary><secondary>password algorithms</secondary>
</indexterm><para>The following task map points to procedures to administer password algorithms.</para><informaltable frame="all" pgwide="1"><tgroup cols="2" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="24.06*"/><colspec colname="colspec2" colwidth="33.74*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Provide strong password encryption</para>
</entry><entry><para><olink targetptr="secsys-20" remap="internal">How to Specify an Algorithm for Password
Encryption</olink></para>
</entry>
</row><row><entry morerows="2"><para>Provide strong password encryption with a name service</para>
</entry><entry><para><olink targetptr="secsys-19" remap="internal">How to Specify a New Password Algorithm
for an NIS Domain</olink></para>
</entry>
</row><row><entry><para><olink targetptr="secsys-18" remap="internal">How to Specify a New Password Algorithm
for an NIS+ Domain</olink></para>
</entry>
</row><row><entry><para><olink targetptr="secsys-21" remap="internal">How to Specify a New Password Algorithm
for an LDAP Domain</olink></para>
</entry>
</row><row><entry><para>Add new password encryption module</para>
</entry><entry><para><olink targetptr="secsys-13" remap="internal">How to Install a Password Encryption Module
From a Third Party</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="secsystask-42"><title>Changing the Default Algorithm for Password
Encryption</title><indexterm><primary><literal>crypt_unix</literal> password algorithm</primary>
</indexterm><para>By default, user passwords are encrypted with the <literal>crypt_unix</literal> algorithm.
You can use a stronger encryption algorithm, such as <olink targetptr="glossary-84" remap="internal">MD5</olink> or <olink targetptr="glossary-133" remap="internal">Blowfish</olink>,
by changing the default password encryption algorithm.</para><task id="secsys-20"><title>How to Specify an Algorithm for Password Encryption</title><indexterm><primary><filename>policy.conf</filename> file</primary><secondary>specifying password algorithms</secondary>
</indexterm><indexterm><primary>configuration files</primary><secondary><filename>policy.conf</filename> file</secondary>
</indexterm><indexterm><primary><filename>/etc/security/policy.conf</filename> file</primary><secondary>algorithms configuration</secondary>
</indexterm><indexterm><primary><filename>policy.conf</filename> file</primary><secondary>specifying encryption algorithms in</secondary>
</indexterm><indexterm><primary>MD5 encryption algorithm</primary><secondary><filename>policy.conf</filename> file</secondary>
</indexterm><indexterm><primary>algorithms</primary><secondary>password</secondary><tertiary>configuration</tertiary>
</indexterm><indexterm><primary>passwords</primary><secondary>specifying algorithm</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>using MD5 encryption algorithm for</secondary>
</indexterm><tasksummary><para>In this procedure, the BSD-Linux version of the MD5 algorithm is the
default encryption algorithm that is used when users change their passwords.
This algorithm is suitable for a mixed network of machines that run the Solaris,
BSD, and Linux versions of UNIX. For a list of password encryption algorithms
and algorithm identifiers, see <olink targetptr="concept-encralg-1" remap="internal">Table&nbsp;2&ndash;1</olink>.</para>
</tasksummary><procedure>&rolePAstep;<step><para><indexterm><primary><envar>CRYPT_DEFAULT</envar> system variable</primary></indexterm><indexterm><primary>system variables</primary><secondary><envar>CRYPT_DEFAULT</envar></secondary></indexterm>Specify the identifier for your chosen encryption
algorithm.</para><para>Type the identifier as the value for the <envar>CRYPT_DEFAULT</envar> variable in the <filename>/etc/security/policy.conf</filename> file.</para><para>You might want to comment the file to explain your choice.</para><screen># <userinput>cat  /etc/security/policy.conf</userinput>
&hellip;
CRYPT_ALGORITHMS_ALLOW=1,2a,md5
#
<userinput># Use the version of MD5 that works with Linux and BSD systems.</userinput>
<userinput># Passwords previously encrypted with __unix__ will be encrypted with MD5</userinput>
<userinput># when users change their passwords.</userinput>
#
#
CRYPT_DEFAULT=__unix__
<userinput>CRYPT_DEFAULT=1</userinput></screen><para><indexterm><primary>using</primary><secondary>new password algorithm</secondary></indexterm><indexterm><primary>passwords</primary><secondary>using new algorithm</secondary></indexterm>In this example, the algorithms configuration ensures
that the weakest algorithm, <literal>crypt_unix</literal>, is never used to
encrypt a password. Users whose passwords were encrypted with the <literal>crypt_unix</literal> module get a <literal>crypt_bsdmd5</literal>-encrypted password
when they change their passwords.</para><para>For more information on configuring the algorithm choices, see the <olink targetdoc="group-refman" targetptr="policy.conf-4" remap="external"><citerefentry><refentrytitle>policy.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</step>
</procedure><example id="secsys-14"><title>Using the Blowfish Algorithm for Password Encryption</title><indexterm><primary>Blowfish encryption algorithm</primary><secondary><filename>policy.conf</filename> file</secondary>
</indexterm><indexterm><primary>Blowfish encryption algorithm</primary><secondary>using for password</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>using Blowfish encryption algorithm for</secondary>
</indexterm><para>In this example, the identifier for the Blowfish algorithm, <literal>2a</literal>,
is specified as the value for the <literal>CRYPT_DEFAULT</literal> variable
in the <filename>policy.conf</filename> file:</para><screen>CRYPT_ALGORITHMS_ALLOW=1,2a,md5
#CRYPT_ALGORITHMS_DEPRECATE=__unix__
CRYPT_DEFAULT=<userinput>2a</userinput></screen><para>This configuration is compatible with BSD systems that use the Blowfish
algorithm.</para>
</example>
</task><task id="secsys-19"><title>How to Specify a New Password Algorithm
for an NIS Domain</title><indexterm><primary><filename>policy.conf</filename> file</primary><secondary>specifying password algorithm</secondary><tertiary>in name services</tertiary>
</indexterm><indexterm><primary>passwords</primary><secondary>specifying algorithm</secondary><tertiary>in name services</tertiary>
</indexterm><indexterm><primary>NIS name service</primary><secondary>specifying password algorithm</secondary>
</indexterm><indexterm><primary>changing</primary><secondary>password algorithm for a domain</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>NIS</secondary><tertiary>specifying new password algorithm</tertiary>
</indexterm><tasksummary><para>When users in an NIS domain change their passwords, the NIS client consults
its local algorithms configuration in the <filename>/etc/security/policy.conf</filename> file.
The NIS client machine encrypts the password.</para>
</tasksummary><procedure><step><para>Specify the password encryption algorithm in the <filename>/etc/security/policy.conf</filename> file on the NIS client.</para>
</step><step><para>Copy the modified <filename>/etc/security/policy.conf</filename> file
to every client machine in the NIS domain.</para>
</step><step><para>To minimize confusion, copy the modified <filename>/etc/security/policy.conf</filename> file to the NIS root server and to the slave servers.</para>
</step>
</procedure>
</task><task id="secsys-18"><title>How to Specify a New Password Algorithm
for an NIS+ Domain</title><indexterm><primary>NIS+ name service</primary><secondary>specifying password algorithm</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>NIS+</secondary><tertiary>specifying new password algorithm</tertiary>
</indexterm><tasksummary><para>When users in an NIS+ domain change their passwords, the NIS+ name service
consults the algorithms configuration in the <filename>/etc/security/policy.conf</filename> file
on the NIS+ master. The NIS+ master, which is running the <command>rpc.nispasswd</command> daemon,
creates the encrypted password.</para>
</tasksummary><procedure><step><para>Specify the password encryption algorithm in the <filename>/etc/security/policy.conf</filename> file on the NIS+ master.</para>
</step><step><para><indexterm><primary>daemons</primary><secondary><command>rpc.nispasswd</command></secondary></indexterm>To minimize confusion, copy the NIS+ master's <filename>/etc/security/policy.conf</filename> file to every host in the NIS+ domain.</para>
</step>
</procedure>
</task><task id="secsys-21"><title>How to Specify a New Password Algorithm for an
LDAP Domain</title><indexterm><primary>LDAP name service</primary><secondary>specifying password algorithm</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>LDAP</secondary><tertiary>specifying new password algorithm</tertiary>
</indexterm><tasksummary><para>When the LDAP client is properly configured, the LDAP client can use
the new password algorithms. The LDAP client behaves just as an NIS client
behaves.</para>
</tasksummary><procedure><step><para>Specify a password encryption algorithm in the <filename>/etc/security/policy.conf</filename> file on the LDAP client.</para>
</step><step><para>Copy the modified <filename>policy.conf</filename> file to every
client machine in the LDAP domain.</para>
</step><step><para>Ensure that the client's <filename>/etc/pam.conf</filename> file
does not use a <literal>pam_ldap</literal> module.</para><para>Ensure that
a comment sign (<literal>#</literal>) precedes entries that include <literal>pam_ldap.so.1</literal>. Also, do not use the new <literal>server_policy</literal> option
with the <literal>pam_authtok_store.so.1</literal> module.</para><para>The PAM entries in the client's <filename>pam.conf</filename> file enable
the password to be encrypted according to the local algorithms configuration.
The PAM entries also enable the password to be authenticated.</para><para>When users in the LDAP domain change their passwords, the LDAP client
consults its local algorithms configuration in the <filename>/etc/security/policy.conf</filename> file. The LDAP client machine encrypts the password. Then, the
client sends the encrypted password, with a <literal>{crypt}</literal> tag,
to the server. The tag tells the server that the password is already encrypted.
The password is then stored, as is, on the server. For authentication, the
client retrieves the stored password from the server. The client then compares
the stored password with the encrypted version that the client has just generated
from the user's typed password.</para><note><para>To take advantage of password policy controls on the LDAP server,
use the <literal>server_policy</literal> option with the <literal>pam_authtok_store</literal> entries in the <filename>pam.conf</filename> file. Passwords are
then encrypted on the server by using the Sun <trademark>Java</trademark> System
Directory Server's cryptographic mechanism. For the procedure, see <olink targetdoc="group-sa" targetptr="sundssetup-13" remap="external">Chapter 11, <citetitle remap="chapter">Setting Up Sun Java System Directory Server With LDAP Clients (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>.</para>
</note>
</step>
</procedure>
</task><task id="secsys-13"><title>How to Install a Password Encryption Module From
a Third Party</title><indexterm><primary><filename>/etc/security/crypt.conf</filename> file</primary><secondary>changing with new password module</secondary>
</indexterm><indexterm><primary><filename>crypt.conf</filename> file</primary><secondary>changing with new password module</secondary>
</indexterm><indexterm><primary><filename>policy.conf</filename> file</primary><secondary>adding password encryption module</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>installing third-party encryption module</secondary>
</indexterm><indexterm><primary>adding</primary><secondary>password encryption module</secondary>
</indexterm><indexterm><primary>installing</primary><secondary>password encryption module</secondary>
</indexterm><indexterm><primary>encryption</primary><secondary>installing third-party password modules</secondary>
</indexterm><indexterm><primary>third-party password algorithms</primary><secondary>adding</secondary>
</indexterm><indexterm><primary><filename>/etc/security/crypt.conf</filename> file</primary><secondary>third-party password modules</secondary>
</indexterm><indexterm><primary><filename>crypt.conf</filename> file</primary><secondary>third-party password modules</secondary>
</indexterm><tasksummary><para>A third-party password encryption algorithm is typically delivered as
a module in a software package. When you run the <command>pkgadd</command> command,
scripts from the vendor should modify the <filename>/etc/security/crypt.conf</filename> file.
You then modify the <filename>/etc/security/policy.conf</filename> file to
include the new module and its identifier.</para>
</tasksummary><procedure><step><para><indexterm><primary><command>pkgadd</command> command</primary><secondary>installing third-party software</secondary></indexterm>Add the
software by using the <command>pkgadd</command> command.</para><para>For detailed
instructions on how to add software, see <olink targetdoc="group-sa" targetptr="swmgrpkgsconcepts-25409" remap="external"><citetitle remap="section">Adding or Removing a Software Package (pkgadd)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Confirm that the new module and module identifier have been added.</para><para>Read the list of encryption algorithms in the <filename>/etc/security/crypt.conf</filename> file.</para><para>For example, the following lines show that a module that implements
the <literal>crypt_rot13</literal> algorithm has been installed.</para><screen># crypt.conf
#
md5 /usr/lib/security/$ISA/crypt_md5.so
<userinput>rot13 /usr/lib/security/$ISA/crypt_rot13.so</userinput>

# For *BSD - Linux compatibility
# 1 is MD5,  2a is Blowfish
1 /usr/lib/security/$ISA/crypt_bsdmd5.so
2a /usr/lib/security/$ISA/crypt_bsdbf.so</screen>
</step><step><para>Add the identifier of the newly installed algorithm to the <filename>/etc/security/policy.conf</filename> file.</para><para>The following lines
show excerpts from the <filename>policy.conf</filename> file that would need
to be modified to add the <literal>rot13</literal> identifier.</para><screen># Copyright 1999-2002 Sun Microsystems, Inc.  All rights reserved.
# ...
#ident  "@(#)policy.conf        1.6     02/06/07 SMI"
# ...
# crypt(3c) Algorithms Configuration
CRYPT_ALGORITHMS_ALLOW=1,2a,md5<userinput>,rot13</userinput>
#CRYPT_ALGORITHMS_DEPRECATE=__unix__
CRYPT_DEFAULT=md5</screen><para>In this example, the <literal>rot13</literal> algorithm is used if the
current password was encrypted with the <literal>crypt_rot13</literal> algorithm.
New user passwords are encrypted with the <literal>crypt_sunmd5</literal> algorithm.
This algorithms configuration works on Solaris-only networks.</para>
</step>
</procedure>
</task>
</sect1><sect1 id="secsys-37"><title>Monitoring and Restricting Superuser (Task Map)</title><indexterm><primary>task maps</primary><secondary>monitoring and restricting superuser</secondary>
</indexterm><indexterm><primary>monitoring</primary><secondary>superuser task map</secondary>
</indexterm><indexterm><primary>restricting</primary><secondary>superuser task map</secondary>
</indexterm><para>The following task map describes how to monitor and restrict the <literal>root</literal> user login.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="24.34*"/><colspec colname="colspec1" colwidth="37.36*"/><colspec colname="colspec2" colwidth="37.30*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Monitor who is using the <command>su</command> command</para>
</entry><entry><para>Scans the <filename>sulog</filename> file on a regular basis.</para>
</entry><entry><para><olink targetptr="secsys-16" remap="internal">How to Monitor Who Is Using the su Command</olink></para>
</entry>
</row><row><entry><para>Display superuser activity on the console</para>
</entry><entry><para>Monitors superuser access attempts as the attempts occur.</para>
</entry><entry><para><olink targetptr="secsys-23" remap="internal">How to Restrict and Monitor Superuser Logins</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="secsystask-44"><title>Monitoring and Restricting Superuser</title><para>An alternative to using the superuser account is to set up role-based
access control. Role-based access control is called RBAC. For overview information
on RBAC, see <olink targetptr="rbac-1" remap="internal">Role-Based Access Control (Overview)</olink>.
To set up RBAC, see <olink targetptr="rbactask-1" remap="internal">Chapter&nbsp;9, Using Role-Based
Access Control (Tasks)</olink>.</para><task id="secsys-16"><title>How to Monitor Who Is Using the <command>su</command> Command</title><indexterm><primary>monitoring</primary><secondary><command>su</command> command attempts</secondary>
</indexterm><indexterm><primary><command>su</command> command</primary><secondary>monitoring use</secondary>
</indexterm><indexterm><primary>access</primary><secondary><literal>root</literal> access</secondary><tertiary>monitoring <command>su</command> command attempts</tertiary>
</indexterm><indexterm><primary><filename>/etc/default/su</filename> file</primary><secondary>monitoring <command>su</command> command</secondary>
</indexterm><indexterm><primary>log files</primary><secondary>monitoring <command>su</command> command</secondary>
</indexterm><indexterm><primary><literal>root</literal> user</primary><secondary>monitoring <command>su</command> command attempts</secondary>
</indexterm><indexterm><primary><command>su</command> file</primary><secondary>monitoring <command>su</command> command</secondary>
</indexterm><indexterm><primary><filename>sulog</filename> file</primary>
</indexterm><indexterm><primary>system security</primary><secondary><command>su</command> command monitoring</secondary>
</indexterm><tasksummary><para>The <filename>sulog</filename> file lists every use of the <command>su</command> command,
not only the <command>su</command> attempts that are used to switch from user
to superuser.</para>
</tasksummary><procedure remap="single-step"><step><para><indexterm><primary><filename>/var/adm/sulog</filename> file</primary><secondary>monitoring contents of</secondary></indexterm><indexterm><primary><filename>sulog</filename> file</primary><secondary>monitoring contents of</secondary></indexterm>Monitor the contents of the <filename>/var/adm/sulog</filename> file
on a regular basis.</para><screen># <userinput>more /var/adm/sulog</userinput>
SU 12/20 16:26 + pts/0 stacey-root
SU 12/21 10:59 + pts/0 stacey-root
SU 01/12 11:11 + pts/0 root-rimmer
SU 01/12 14:56 + pts/0 pmorph-root
SU 01/12 14:57 + pts/0 pmorph-root</screen><itemizedlist><para>The entries display the following information:</para><listitem><para>The date and time that the command was entered.</para>
</listitem><listitem><para><indexterm><primary>+ (plus sign)</primary><secondary><filename>sulog</filename> file</secondary></indexterm><indexterm><primary>plus sign (+)</primary><secondary>entry in <filename>sulog</filename> file</secondary></indexterm><indexterm><primary>- (minus sign)</primary><secondary><filename>sulog</filename> file</secondary></indexterm><indexterm><primary>minus sign (-)</primary><secondary>entry in <filename>sulog</filename> file</secondary></indexterm>If the attempt was successful.
A plus sign (<literal>+</literal>) indicates a successful attempt. A minus
sign (<literal>-</literal>) indicates an unsuccessful attempt.</para>
</listitem><listitem><para>The port from which the command was issued.</para>
</listitem><listitem><para>The name of the user and the name of the switched identity.</para>
</listitem>
</itemizedlist><para>The <command>su</command> logging in this file is enabled by default
through the following entry in the <filename>/etc/default/su</filename> file:</para><screen>SULOG=/var/adm/sulog</screen>
</step>
</procedure><taskrelated role="troubleshooting"><para>Entries that include <computeroutput>???</computeroutput> indicate that
the controlling terminal for the <command>su</command> command cannot be identified.
Typically, system invocations of the <command>su</command> command before
the desktop appears include <computeroutput>???</computeroutput>, as in <computeroutput>SU 10/10 08:08 + ??? root-root</computeroutput>. After the user starts a desktop
session, the <command>ttynam</command> command returns the value of the controlling
terminal to the <filename>sulog</filename>: <computeroutput>SU 10/10 10:10
+ pts/3 jdoe-root</computeroutput>.</para><para>Entries similar to the following can indicate that the <command>su</command> command
was not invoked on the command line: <computeroutput>SU 10/10 10:20 + ???
root-oracle</computeroutput>. The user might have switched to the oracle role
by using a GUI.</para>
</taskrelated>
</task><task id="secsys-23"><title>How to Restrict and Monitor Superuser Logins</title><indexterm><primary>access</primary><secondary><literal>root</literal> access</secondary><tertiary>restricting</tertiary>
</indexterm><indexterm><primary><filename>/etc/default/login</filename> file</primary><secondary>restricting remote <literal>root</literal> access</secondary>
</indexterm><indexterm><primary>logging in</primary><secondary><literal>root</literal> login</secondary><tertiary>restricting to console</tertiary>
</indexterm><indexterm><primary><filename>login</filename> file</primary><secondary>restricting remote <literal>root</literal> access</secondary>
</indexterm><indexterm><primary><literal>root</literal> user</primary><secondary>restricting remote access</secondary>
</indexterm><indexterm><primary><literal>root</literal> user</primary><secondary>restricting remote access</secondary>
</indexterm><indexterm><primary>system security</primary><secondary>restricting remote <literal>root</literal> access</secondary>
</indexterm><indexterm><primary>system security</primary><secondary><literal>root</literal> access restrictions</secondary>
</indexterm><indexterm><primary>disabling</primary><secondary>remote <literal>root</literal> access</secondary>
</indexterm><indexterm><primary>remote logins</primary><secondary>preventing superuser from</secondary>
</indexterm><indexterm><primary>security</primary><secondary>preventing remote login</secondary>
</indexterm><indexterm><primary>monitoring</primary><secondary>superuser access attempts</secondary>
</indexterm><indexterm><primary>superuser</primary><secondary>monitoring access attempts</secondary>
</indexterm><indexterm><primary><filename>/etc/default/su</filename> file</primary><secondary>monitoring access attempts</secondary>
</indexterm><indexterm><primary>access</primary><secondary><literal>root</literal> access</secondary><tertiary>displaying attempts on console</tertiary>
</indexterm><indexterm><primary>console</primary><secondary>displaying <command>su</command> command attempts</secondary>
</indexterm><indexterm><primary>displaying</primary><secondary><literal>root</literal> access attempts</secondary>
</indexterm><indexterm><primary>displaying</primary><secondary><command>su</command> command attempts</secondary>
</indexterm><indexterm><primary><filename>/etc/default/su</filename> file</primary><secondary>displaying <command>su</command> command attempts</secondary>
</indexterm><indexterm><primary><literal>root</literal> user</primary><secondary>displaying access attempts on console</secondary>
</indexterm><indexterm><primary><command>su</command> command</primary><secondary>displaying access attempts on console</secondary>
</indexterm><tasksummary><para>This method immediately detects superuser attempts to access the local
system.</para>
</tasksummary><procedure><step><para>View the <literal>CONSOLE</literal> entry in the <filename>/etc/default/login</filename> file.</para><screen>CONSOLE=/dev/console</screen><para>By default, the console device is set to <literal>/dev/console</literal>.
With this setting, <literal>root</literal> can log in to the console. <literal>root</literal> cannot log in remotely.</para>
</step><step><para>Verify that <literal>root</literal> cannot log in remotely.</para><para>From a remote system, try to log in as superuser.</para><screen>mach2 % <userinput>rlogin -l root mach1</userinput>
Password: <lineannotation>&lt;Type root password of mach1&gt;</lineannotation>
Not on system console
Connection closed.</screen>
</step><step><para>Monitor attempts to become superuser.</para><para>By default,
 attempts to become superuser are printed to the console by the <literal>SYSLOG</literal> utility.</para><substeps><step><para>Open a terminal console on your desktop.</para>
</step><step><para>In another window, use the <command>su</command> command to become
superuser.</para><screen>% <userinput>su -</userinput>
Password: <lineannotation>&lt;Type root password&gt;</lineannotation>
#</screen><para>A message is printed on the terminal console.</para><screen>Sep 7 13:22:57 mach1 su: 'su root' succeeded for jdoe on /dev/pts/6</screen>
</step>
</substeps>
</step>
</procedure><example id="secsys-45"><title>Logging Superuser Access Attempts</title><para>In this example, superuser attempts are not being logged by <literal>SYSLOG</literal>. Therefore, the administrator is logging those attempts by removing
the comment from the <literal>#CONSOLE=/dev/console</literal> entry in the <filename>/etc/default/su</filename> file.</para><screen># CONSOLE determines whether attempts to su to root should be logged
# to the named device
#
CONSOLE=/dev/console</screen><para>When a user attempts to become superuser, the attempt is printed on
the terminal console.</para><screen>SU 09/07 16:38 + pts/8 jdoe-root</screen>
</example><taskrelated role="troubleshooting"><para>To become superuser from a remote system when the <filename>/etc/default/login</filename> file contains the default <literal>CONSOLE</literal> entry, users
must first log in with their user name. After logging in with their user name,
users then can use the <command>su</command> command to become superuser.</para><para>If the console displays an entry similar to <literal>Mar 16 16:20:36
mach1 login: ROOT LOGIN /dev/pts/14 FROM mach2.Example.COM</literal>, then
the system is permitting remote <literal>root</literal> logins. To prevent
remote superuser access,  change the <literal>#CONSOLE=/dev/console</literal> entry
to <literal>CONSOLE=/dev/console</literal> in the <filename>/etc/default/login</filename> file.</para>
</taskrelated>
</task>
</sect1><sect1 id="secsys-29" arch="sparc"><title>Controlling Access to System Hardware
(Task Map)</title><indexterm><primary>task maps</primary><secondary>controlling access to system hardware</secondary>
</indexterm><indexterm><primary>task maps</primary><secondary>protecting system hardware</secondary>
</indexterm><indexterm><primary>preventing</primary><secondary>access to system hardware</secondary>
</indexterm><indexterm><primary>controlling</primary><secondary>access to system hardware</secondary>
</indexterm><para>The following task map describes how to protect the PROM from unwanted
access.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="24.40*"/><colspec colname="colspec1" colwidth="41.20*"/><colspec colname="colspec2" colwidth="33.40*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Prevent users from changing system hardware settings</para>
</entry><entry><para>Requires a password to modify PROM settings.</para>
</entry><entry><para><olink targetptr="secsys-38" remap="internal">How to Require a Password for Hardware
Access</olink></para>
</entry>
</row><row><entry><para>Disable the abort sequence</para>
</entry><entry><para>Prevents users from accessing the PROM.</para>
</entry><entry><para><olink targetptr="secsys-30" remap="internal">How to Disable a System's Abort Sequence</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="secsystask-46"><title>Controlling Access to System Hardware</title><indexterm><primary>hardware</primary><secondary>protecting</secondary>
</indexterm><indexterm><primary>system hardware</primary><secondary>controlling access to</secondary>
</indexterm><indexterm><primary>security</primary><secondary>protecting hardware</secondary>
</indexterm><indexterm><primary>security</primary><secondary>protecting PROM</secondary>
</indexterm><indexterm><primary>PROM security mode</primary>
</indexterm><indexterm><primary><command>eeprom</command> command</primary>
</indexterm><indexterm><primary>system security</primary><secondary>hardware protection</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>PROM security mode</secondary>
</indexterm><indexterm><primary>configuring</primary><secondary>hardware security</secondary>
</indexterm><indexterm><primary>access</primary><secondary>restricting for</secondary><tertiary>system hardware</tertiary>
</indexterm><indexterm><primary>security</primary><secondary>system hardware</secondary>
</indexterm><indexterm><primary>access</primary><secondary>security</secondary><tertiary>system hardware</tertiary>
</indexterm><para>You can protect the physical machine by requiring a password to gain
access to the hardware settings. You can also protect the machine by preventing
a user from using the abort sequence to leave the windowing system.</para><task id="secsys-38"><title>How to Require a Password for Hardware Access</title><indexterm><primary>adding</primary><secondary>security to system hardware</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>requiring for hardware access</secondary>
</indexterm><indexterm><primary>hardware</primary><secondary>requiring password for access</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>hardware access and</secondary>
</indexterm><indexterm><primary>configuring</primary><secondary>password for hardware access</secondary>
</indexterm><indexterm><primary>protecting</primary><secondary>BIOS, pointer to</secondary>
</indexterm><indexterm><primary>protecting</primary><secondary>PROM</secondary>
</indexterm><indexterm><primary>roles</primary><secondary>using to access the hardware</secondary>
</indexterm><tasksummary><para>On an x86 system, the equivalent to protecting the PROM is to protect
the BIOS. Refer to your machine's manuals for how to protect the BIOS.</para>
</tasksummary><procedure><step><para><indexterm><primary>rights profiles</primary><secondary>using the System Administrator profile</secondary></indexterm><indexterm><primary>System Administrator (RBAC)</primary><secondary>protecting hardware</secondary></indexterm>Become superuser or assume a role that includes the Device Security
profile, the Maintenance and Repair profile, or the System Administrator profile.</para><para>The System Administrator profile includes the Maintenance and
Repair profile. To create a role that includes the System Administrator profile
and to assign the role to a user, see <olink targetptr="rbactask-15" remap="internal">Configuring
RBAC (Task Map)</olink>.</para>
</step><step><para>In a terminal window, type the PROM security mode.</para><screen># <userinput>eeprom security-mode=command</userinput>

Changing PROM password:
New password: <lineannotation>&lt;Type password&gt;</lineannotation>
Retype new password: <lineannotation>&lt;Retype password&gt;</lineannotation>	</screen><para>Choose the value <literal>command</literal> or <literal>full</literal>.
For more details, see the <olink targetdoc="group-refman" targetptr="eeprom-1m" remap="external"><citerefentry><refentrytitle>eeprom</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para><para>If, when you type the preceding command, you are not prompted for a
PROM password, the system already has a PROM password.</para>
</step><step performance="optional"><para>To change the PROM password, type the following
command:</para><screen># <userinput>eeprom security-password=</userinput> <lineannotation>Press Return</lineannotation>
Changing PROM password:
New password: <lineannotation>&lt;Type password&gt;</lineannotation>
Retype new password: <lineannotation>&lt;Retype password&gt;</lineannotation></screen><para>The new PROM security mode and password are in effect immediately. However,
they are most likely to be noticed at the next boot.</para><caution><para>Do not forget the PROM password. The hardware is unusable without
this password.</para>
</caution>
</step>
</procedure>
</task><task id="secsys-30"><title>How to Disable a System's Abort Sequence</title><indexterm><primary>enabling</primary><secondary>keyboard abort</secondary>
</indexterm><indexterm><primary>disabling</primary><secondary>keyboard abort</secondary>
</indexterm><indexterm><primary>variables</primary><secondary><literal>KEYBOARD_ABORT</literal></secondary>
</indexterm><indexterm><primary>disabling</primary><secondary>keyboard shutdown</secondary>
</indexterm><indexterm><primary>disabling</primary><secondary>abort sequence</secondary>
</indexterm><indexterm><primary>disabling</primary><secondary>system abort sequence</secondary>
</indexterm><indexterm><primary><filename>/etc/default/kbd</filename> file</primary>
</indexterm><indexterm><primary><filename>kbd</filename> file</primary>
</indexterm><indexterm><primary><envar>KEYBOARD_ABORT</envar> system variable</primary>
</indexterm><indexterm><primary>system variables</primary><secondary><envar>KEYBOARD_ABORT</envar></secondary>
</indexterm><tasksummary><para>Some server systems have a key switch. When the key switch is set in
the secure position, the switch overrides the software keyboard abort settings.
So, any changes that you make with the following procedure might not be implemented.</para>
</tasksummary><procedure>&rolePAstep;<step><para>Change the value of <literal>KEYBOARD_ABORT</literal> to <literal>disable</literal>.</para><para>Comment out the <literal>enable</literal> line in
the <filename>/etc/default/kbd</filename> file. Then, add a <literal>disable</literal> line:</para><screen># <userinput>cat /etc/default/kbd</userinput>
&hellip;
# KEYBOARD_ABORT affects the default behavior of the keyboard abort
# sequence, see kbd(1) for details.  The default value is "enable".
# The optional value is "disable".  Any other value is ignored.
&hellip;
<userinput>#KEYBOARD_ABORT=enable</userinput>
<userinput>KEYBOARD_ABORT=disable</userinput></screen>
</step><step><para>Update the keyboard defaults.</para><screen># <userinput>kbd -i</userinput></screen>
</step>
</procedure>
</task>
</sect1>
</chapter><?Pub *0000068109 0?>