Basic Red Hat Linux
Basic Red Hat Linux
Basic Red Hat Linux
Werner Puschitz
Last fiddled: July 7, 2002.
For information on Red Hat Linux, Installation, Documentation, Kernel, Oracle, and Linux in general,
see www.puschitz.com.
General
Log Files
Authentication Files:
/var/run/utmp
/var/log/wtmp
/var/log/btmp
/var/log/secure
/var/log/lastlog
Server-specific Logs:
/var/log/xferlog (ftpd logging information)
/var/log/maillog (sendmail logging information)
/var/log/pacct
...
Here is a list of commands you can use to get data about user logins:
who Shows a listing of currently logged-in users. This command reads /var/log/utmp.
w Shows who is logged on and what they are doing.
last Shows a list of last logged-in users, including login time, logout time etc. This command reads
/var/log/wtmp.
lastb Same as last, except that by default it shows a log of the file /var/log/btmp, which contains
all the bad login attempts.
lastlog This command reports data maintained in /var/log/lastlog, which is a record of the last
time a user logged in.
ac Prints out the connect time in hours on a per-user basis or daily basis etc. This command reads
/var/log/wtmp.
dump-utmp Converts the raw data from /var/run/utmp or /var/log/wtmp into ASCII-parsable format.
ftpwho The ftpwho program utility displays all active ftp users, and their current process information
1 of 5 2/25/2010 11:29 AM
Securing Red Hat Linux (Step-by-Step Security Guide/HOWTO), http://www.blacksheepnetworks.com/security/resources/redhat-7.3-securi...
on the system.
The output of the command is in the format of the "/bin/ps" command.
ftpcount The ftpcount program utility, a simplified version of ftpwho, shows only the current number of
users logged in to
the system, and the maximum number of users allowed.
You should make sure that you remove all packages you don't need on a production server (e.g compilers,
development packages, X, etc.).
You might want to disable the "Control-Alt-Del" key sequence. To do that, make sure the
following line is commented out in the /etc/inittab file:
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now
Make sure that the change becomes effective immediately by invoking the following command:
init q
Some recommend to add, for example, the following line in the /etc/inittab file to ensure that
a root password is required for the Single User Mode logon:
~~:S:wait:/sbin/sulogin
But this would give you a false sense of security. When you get into the Single User Mode, it will
certainly ask you for the root password. But it's too easy to get around. Instead of using "linux
single", you can also use "linux init=/bin/bash" which will not ask for the root password.
2 of 5 2/25/2010 11:29 AM
Securing Red Hat Linux (Step-by-Step Security Guide/HOWTO), http://www.blacksheepnetworks.com/security/resources/redhat-7.3-securi...
Services
To get a list of all enabled services, execute the following command:
chkconfig --list
TO BE CONTINUED... :-)
TCP Wrapper
TO BE CONTINUED... :-)
When a new user account is created with useradd, some of these settings are recorded in the /etc/passwd
3 of 5 2/25/2010 11:29 AM
Securing Red Hat Linux (Step-by-Step Security Guide/HOWTO), http://www.blacksheepnetworks.com/security/resources/redhat-7.3-securi...
/etc/passwd:
<username>:x:UID_MIN+:GROUP:<GECOS>:HOME/<username>:SHELL
/etc/shadow:
<username>:<password>:<date>:PASS_MIN_DAYS:PASS_MAX_DAYS:PASS_WARN_AGE:INACTIVE:EXPIRE:
-n specifies that the user's primary group name should not be the same as the user being added; the user's
primary group will be "users".
-c specifies the name of the user.
-G weel specifies that the user will be added to the supplementary group "wheel". Users who are member of
the "wheel" group will be able to successfully switch to the user root with the "su" command. See PAM how
you can use pam_wheel to enforce the restriction of successful "su to root" executions.
This PAM module permits root authentication to members of the wheel group only. Ensure that the following
parameters are set:
/lib/security/pam_wheel.so use_uid
TO BE CONTINUED... :-)
4 of 5 2/25/2010 11:29 AM
Securing Red Hat Linux (Step-by-Step Security Guide/HOWTO), http://www.blacksheepnetworks.com/security/resources/redhat-7.3-securi...
Warning and Disclaimer: Every effort has been made to provide the information as accurate as possible, but no warranty or fitness is
implied. The author shall have no liability nor responsibility to any loss or damages arising from the information contained on this
web site.
Comments? [email protected]
5 of 5 2/25/2010 11:29 AM