Hardening a Linux Server

1. Recon First
For a CTF, Grab n Crack
Grab the Hashes for Cracking (swap out the IP)
scp root@server_ip:/etc/passwd ./passwd
scp root@server_ip:/etc/shadow ./shadow
Unshadow
unshadow passwd shadow > combined.txt
Run John
john combined.txt
Review and Note
john --show combined.txt
SSH in and Change Passwords
ssh root@server_ip
passwd username
Document Normal Running Processes
ps aux > processes.txt
OS Info
cat /etc/os-release
2. Least Privilege
Review Current Permissions
Audit the current user accounts, groups, and their permissions on each server.
cat /etc/passwd
getent passwd
Checking GUID/SUID files
find / -perm -4000 -type f 2>/dev/null


Using a virtual environment (venv) in Python creates an isolated spaces for projects. Isolation ensures that each project has its own dependencies, regardless of what dependencies other projects might have. 




