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 – setting a kernel capability

For this lab, you'll allow a normal user to run a Python web server. You can use any of your virtual machines. Let's get started:

  1. If Apache is installed on your virtual machine, ensure that it's stopped for Ubuntu:
sudo systemctl stop apache2

For CentOS, do the following:

sudo systemctl stop httpd
  1. Install Python 2 for Ubuntu:
sudo apt install python

For CentOS 7, do the following:

sudo yum install python

For CentOS 8, do the following:

sudo dnf install python2
  1. From within your own home directory, attempt to start the Python SimpleHTTPServer with just your normal user privileges, and note the error message on Ubuntu and CentOS 7:
python -m SimpleHTTPServer 80

On CentOS 8, you'll see the following: ...

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