Synthetic view of a server.

Share this link

To harden a server or simply reduce its security footprint, it is very useful to get a list of the main processes running. However, it is not an obvious task to get a synthetic view like this.

Using a command like ps -edf brings too much information and doesn’t really help you.

I recently came across the pstree command and found it quite useful.

First, install the psmisc package available in the base repository:

# yum install -y psmisc

Then, execute the pstree command:

# pstree
systemd─┬─NetworkManager───2*[{NetworkManager}]
        ├─abrt-watch-log
        ├─abrtd
        ├─2*[agetty]
        ├─atd
        ├─auditd───{auditd}
        ├─chronyd
        ├─crond
        ├─dbus-daemon───{dbus-daemon}
        ├─firewalld───{firewalld}
        ├─httpd───6*[httpd]
        ├─lsmd
        ├─lvmetad
        ├─master─┬─pickup
        │        └─qmgr
        ├─polkitd───5*[{polkitd}]
        ├─rngd
        ├─rsyslogd───2*[{rsyslogd}]
        ├─smartd
        ├─sshd─┬─sshd───bash───pstree
        │      └─sshd───sshd
        ├─systemd-journal
        ├─systemd-logind
        ├─systemd-udevd
        └─tuned───4*[{tuned}]

As the test was performed on a virtual machine, I could quickly see that the smartd daemon (part of the smartmontools package) was running. This daemon monitors disk health: this is completely useless in a virtual environment where all disks are already managed by the host or a dedicated storage subsystem.

# systemctl disable --now smartd
# yum remove -y smartmontools

I hope you find this tool as useful as I found it.

Posted in RHEL7

RHCSA7: Task of the day

Allowed time: 5 minutes.
Create a user called tom. Create a directory named /private. Use an acl to only allow access (rwx) to tom to the private directory.

RHCE7: Task of the day

Allowed time: 10 minutes.
Configure a system to forward all email to a central mail server at 192.168.1.1 (change the IP address accordingly).

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...

Archives