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.
Recent Comments