Lfcs 672321686224144477
Lfcs 672321686224144477
Generic Skills
Generic Skills
Click to edit Master title style
• sudo apt install apt-file
• apt-file update
• apt-file search myfile
• mandb; man -k anything
Lab1: Finding Packages (5 minutes)
Click to edit Master title style
• Find the package that contains the seinfo file
Click to edit Master title style
User Management
User Management
Click to edit Master title style
• useradd -m isabelle
• groupadd profs
• groupadd staff
• useradd -m -G profs isabelle
• useradd -m -s /usr/bin/nologin marcha
• usermod -aG staff isabelle
• usermod -g staff isabelle
• passwd isabelle
Lab 2: Managing Users (7 minutes)
Click to edit Master title style
• Create the groups sales with GID 1024 and account with GID 1025
• Create user anna and makes sure she is a member of the group sales as a
secondary group. She should also have a home directory
• Change primary group membership for anna to the group sales
• Create user linda and ensure she cannot use an interactive shell
• Set passwords for all users to "mypassword"
Click to edit Master title style
Resource restrictions
Understanding Resource Restrictions
Click to edit Master title style
• ulimit is the legacy way to implement resource restrictions
• Modern Linux offers Cgroups through systemd
• Using Cgroups is recommended
• On the exam, make sure you know how to work with ulimit
• Find the file limits.conf, have a look at it and you'll know what to do
Lab 3: Setting Resource Restrictions (5 min)
Click to edit Master title style
• Configure a soft limit such that user lisa cannot start more than 4
processes and set the hard limit to 8
Click to edit Master title style
Storage Management
Essential tools
Click to edit Master title style
• du
• df
Lab 4: Monitoring Storage (5 min)
Click to edit Master title style
• Create a list of all storage devices that currently are using less than 90%
of their disk space and write the names of these devices to the file
/tmp/storage-use.txt
Click to edit Master title style
LVM Management
Essential Tools
Click to edit Master title style
• lvs
• vgs
• lvresize -r
Lab 5: Configuring LVM (15 minutes)
Click to edit Master title style
• Use the dd and losetup utilities to create a loop device with a size of
1GiB
• Create an LVM volume group with the name vgdata that uses 800 MiB of
this loop device
• Create an LVM logical volume with the name lvdata with a size of 600
MiB
• Format the logical volume with the Ext4 file system and mount it
persistently on the directory /data
• Resize the logical volume to grow to a size of 750 MiB. The Ext4 file
system should also be grown and you're not allowed to unmount the
logical volume
Click to edit Master title style
Analyzing Performance
Essential Tools
Click to edit Master title style
• iostat
• top
• iotop
• kill
• lsof
Lab 7: Managing Storage Performance (5 min)
Click to edit Master title style
• Find the busiest storage device
• Stop the process that causes the highest write load on that storage
device
• Write the name of that process to the file /tmp/storage.txt
Click to edit Master title style
Using find
Essential Tools
Click to edit Master title style
• find /mydir -name "*.txt" -size +5m -exec rm {} \;
Lab 8: Finding Files (8 min)
Click to edit Master title style
• Find all files that are owned by user anna and copy them to the directory
/root/anna/. Use one single commandline to perform this task
Click to edit Master title style
Troubleshooting Systemd
Services
Essential Tools
Click to edit Master title style
• systemctl status
• journalctl
Lab 14: Verifying apache2 working
Click to edit Master title style
• Run the script run-apache2.sh from the course Git repository at
https://github.com/sandervanvugt/lfcs
• Do NOT open the script to read its contents!
• This script should install and run the apache2 web service
• Verify that it is working correctly
Click to edit Master title style
Docker
Key Skills
Click to edit Master title style
• docker build -t myapp:latest
• man docker-run
• docker run -d -p -m 512 myapp
Lab 17: Managing Containers (15 minutes)
Click to edit Master title style
• Use the Dockerfile in the course Git repository to build an image with the
name myapp:latest
• Start a container based on this image
• Also start a container based on the nginx image from the Docker Hub
registry. Ensure that it runs in the background. Expose port 80 in the
container to port 8080 on the host that runs the container. Limit the
memory this container can use to 256 MiB and ensure it starts when the
host computer is starting
Click to edit Master title style
Git Repositories
Git essentials
Click to edit Master title style
• git add
• git commit -m mymessage
• git push
Click to edit Master title style