![]() |
![]() |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Chapter 3Securing Machines (Tasks)This chapter describes the procedures for securing machines in the Solaris environment. The procedures are introduced in the following section: For overview information about machine security, see Chapter 2, Managing Machine Security (Overview). Securing Machines (Task Map)A computer is as secure as its weakest point of entry. The following task map shows the areas that you should monitor and secure.
Securing Logins and PasswordsThis section describes how to control and monitor logins.
|
# logins -x -l username |
-x | Displays an extended set of login status information. |
-l username | Displays the login status for the specified user. username is a user's login name. Multiple login names must be specified in a comma-separated list. |
The logins command uses the appropriate password file to obtain a user's login status. The file can be the local /etc/passwd file , or a password database for the name service. For more information, see the logins(1M) man page.
In the following example, the login status for the user rimmer is displayed.
# logins -x -l rimmer
rimmer 500 staff 10 Annalee J. Rimmer
/export/home/rimmer
/bin/sh
PS 010170 10 7 -1
|
rimmer | Identifies the user's login name. |
500 | Identifies the user ID (UID). |
staff | Identifies the user's primary group. |
10 | Identifies the group ID (GID). |
Annalee J. Rimmer | Identifies the comment. |
/export/home/rimmer | Identifies the user's home directory. |
/bin/sh | Identifies the login shell. |
PS 010170 10 7 -1 | Specifies the password aging information:
|
How to Display Users Without PasswordsBecome superuser or assume an equivalent role.
Display all users who have no passwords by using the logins command.
# logins -p |
The -p option displays a list of users with no passwords. The logins command can use the password databases on the local machine and on the network. The command can use the local /etc/passwd file. The command can use the password databases for the name services to obtain a user's login status.
The following example shows that the user pmorph does not have a password.
# logins -p pmorph 501 other 1 Polly Morph # |
How to Temporarily Disable User LoginsBecome superuser or assume an equivalent role.
Create the /etc/nologin file by using an editor.
# vi /etc/nologin |
Include a message about system availability.
Close and save the file.
Create this file to disallow user logins during system shutdown or routine maintenance. If a user attempts to log in to a system where the nologin file exists, the contents of this file are displayed. Then, the user login is terminated.
Superuser logins are not affected. For more information, see the nologin(4) man page.
This example shows how to notify users of system unavailability.
# vi /etc/nologin (Add system message here) # cat /etc/nologin ***No logins permitted.*** ***The system will be unavailable until 12 noon.*** |
You can also bring the system to run level 0, single-user mode. For information on bringing the system to single-user mode, see "Shutting Down a System (Tasks)" in System Administration Guide: Basic Administration.
How to Save Failed Login AttemptsCreate the loginlog file in the /var/adm directory.
# touch /var/adm/loginlog |
Set read and write permissions for root on the loginlog file.
# chmod 600 /var/adm/loginlog |
Change group membership to sys on the loginlog file.
# chgrp sys /var/adm/loginlog |
Make sure that the log works by attempting to log into the system five times with the wrong password. Then, display the /var/adm/loginlog file.
# more /var/adm/loginlog rimmer:/dev/pts/1:Wed Jan 16 09:22:31 2002 rimmer:/dev/pts/1:Wed Jan 16 09:22:39 2002 rimmer:/dev/pts/1:Wed Jan 16 09:22:45 2002 rimmer:/dev/pts/1:Wed Jan 16 09:22:53 2002 rimmer:/dev/pts/1:Wed Jan 16 09:23:01 2002 # |
The loginlog 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.
The loginlog file might grow quickly. To use this file in a timely manner, you should check and clear its contents occasionally. A loginlog file that shows a lot of activity can indicate an attempt to break into the computer system. For more information, see the loginlog(4) man page.
Previous Contents Index Next ![]() |