DEV Community

Faruk
Faruk

Posted on • Originally published at Medium

How to Audit a Linux or Ubuntu Server Like a Security Consultant | by Faruk Ahmed | May, 2025

Member-only story

How to Audit a Linux or Ubuntu Server Like a Security Consultant

--

Share

✍️ Full Blog Content:

Intro:

You don’t need a badge or a clipboard to audit a Linux server — just a sharp eye, solid tools, and the right checklist. Whether it’s your own system or a client’s, these are the exact steps I take to audit a server for misconfigurations, weak security, and hidden risks. This is how you think like a consultant — and act like one too.

1. Start With the Obvious: Who Has Access?

✅ List all users:

cut -d: -f1 /etc/passwd
Enter fullscreen mode Exit fullscreen mode

✅ Check for users with UID 0 (root-equivalent):

awk -F: '$3 == 0 { print $1 }' /etc/passwd
Enter fullscreen mode Exit fullscreen mode

✅ Review group memberships:

getent group sudo
Enter fullscreen mode Exit fullscreen mode

✅ Look for unexpected .bash_history entries:

find /home -name .bash_history -exec cat {} \;
Enter fullscreen mode Exit fullscreen mode

2. Identify Running Services and Open Ports

✅ Use:

sudo ss -tuln
Enter fullscreen mode Exit fullscreen mode

✅ Check services that start at boot:

systemctl list-unit-files --state=enabled
Enter fullscreen mode Exit fullscreen mode

👉 Read Full Blog on Medium Here

Top comments (0)