Unusual Login Activity
- Check
/var/log/auth.logor/var/log/secure(depending on your Linux distribution) for failed login attempts from unfamiliar IP addresses. - Look for successful logins at unusual times or from unexpected geographic locations.
- Use the
lastcommand to see a list of recent logins and logout times. - The
whocommand will show you who is currently logged into your system.
Tip
Unfamiliar Processes or Resource Usage
- Use
toporhtopto view running processes and system resource usage. Look for processes with unfamiliar names or high CPU/memory consumption. - The
ps auxcommand provides a more detailed list of all running processes. Pay attention to processes owned by unknown users. - Check network activity with
netstat -tulnpto see open ports and established connections. Unfamiliar connections could indicate a compromise. - Examine the
/tmpdirectory for unusual files or executables that might have been dropped by an attacker.
Important
Altered System Files or Configuration
- Inspect the
/etc/ssh/sshd_configfile for unauthorised changes, such as new allowed users or altered port numbers. - Check the
~/.ssh/authorized_keysfiles for any unfamiliar public keys that could grant unauthorised access. - Use the
find / -ctime -7command (or a similar period) to look for recently modified files across your system, especially in critical directories. - Review your system's package manager logs (e.g.,
/var/log/dpkg.logfor Debian/Ubuntu or/var/log/yum.logfor CentOS/RHEL) for any unexpected package installations.
Good to know
Unexpected Network Outgoing Connections
- Use
netstat -natpto display all active network connections. Look for connections to unusual IP addresses or on non-standard ports. - The
lsof -icommand can show you which processes are using network connections. - Check your firewall logs (e.g.,
ufw status verboseorfirewall-cmd --list-all) for any unexpected outgoing rules. - Examine DNS resolution logs (if available) for suspicious domain lookups from your system.
Tip
Was this guide helpful?
Know someone who needs this? Send them the guide.
Written by
Jordan DicksonFounder, CyberSecurityGuides
Founder of CyberSecurityGuides, writing practical, jargon-free guides that help everyday people recover from and protect against online attacks.
Reviewed by CSG Security Engineers