Skip to Content
Mastering Linux Security and Hardening - Second Edition
book

Mastering Linux Security and Hardening - Second Edition

by Donald A. Tevault
February 2020
Intermediate to advanced
666 pages
15h 45m
English
Packt Publishing
Content preview from Mastering Linux Security and Hardening - Second Edition

Hands-on lab – using auditd

In this lab, you'll practice using the features of auditd. Let's get started:

  1. For Ubuntu only, install auditd:
sudo apt updatesudo apt install auditd
  1. View the rules that are currently in effect:
sudo auditctl -l
  1. From the command line, create a temporary rule that audits the /etc/passwd file for changes. Verify that the rule is in effect:
sudo auditctl -w /etc/passwd -p wa -k passwd_changessudo auditctl -l

Create a user account for Lionel. On Ubuntu, do the following:

sudo adduser lionel

On CentOS, do the following:

sudo useradd lionelsudo passwd lionel
  1. Search for audit messages regarding any changes to the passwd file:
sudo ausearch -i -k passwd_changessudo aureport -i -k | grep 'passwd_changes'
  1. Log out ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Security and Hardening - Third Edition

Mastering Linux Security and Hardening - Third Edition

Donald A. Tevault
UNIX and Linux System Administration Handbook, 5th Edition

UNIX and Linux System Administration Handbook, 5th Edition

Trent R. Hein, Evi Nemeth, Garth Snyder, Ben Whaley, Dan Mackin

Publisher Resources

ISBN: 9781838981778Supplemental Content