SOS(en)

Z David Seidl
Skočit na navigaci Skočit na vyhledávání

Literature

You can find much information on the internet, use Google

Lesson 1 (Linux history, Virtualbox, Debian instalation)

Install Virtualbox (www.virtualbox.org) on your computer or use Virtualbox on computer in class.

Download iso file with network installation of debian distribution of GNU/Linux. (www.debian.org)

Practise

Install debian on your virtual PC identically as in lecture.

Lesson 2 (Bash script)

Practise

On your server in the /opt/SOS/villages/ directory create a directory structure where the directory name will match the names of all villages in the Czech Republic 
whose name contains "ova" and does not contain the word "Nova". Replace any spaces with underscores. 
List of villages in text form can be found here: http://seidl.cs.vsb.cz/download/seznam-obci-cr.txt

Practise

On your server in the /opt/SOS/post/ directory, create a directory structure where the name of the directories will match the names of all the post offices
in the Czech Republic whose     phone number contains a 5 digit and does not contain a pocket of numbers 55. Replace any spaces with underscores.
You can find a list of Czech postal text here: http://seidl.cs.vsb.cz/download/posty.csv.txt

>>> "Praha 10";"10000";"Cernokostelecka 2020/20, Praha";"274774998";"274776503";"B" <<< phone number is bold

In each folder, create a text file with any name. In the file, list all names of the post offices in the Czech Republic with the same number of letters as the current folder name.


Lesson 3 (init process, systemd)

Practise

Create a bash script and service for systemd. The script scans all the subdirectories in the /home folder. 
If it finds a file whose name ends in * .backup, it moves this file to the /backup directory. Use find to search.

Practise

Create a bash script and service for systemd. The script finds the size of all directories in the / home folder. 
If the size of one of the directories is larger than 1kB, a file named "THE_MAX_FILE_SIZE_HAS_BEEN_EXCEEDED" 
will be placed in this folder.

Lesson 4 (hard disks management, RAID)

Practise

Add another four SATA drives to your virtualized PC. Create a RAID 5 with one spare disk above them.

Create file system ext4 on raid a mount raid to  /home folder. Copy all data. 
Modify the / etc / fstab file so that the raid connection to the / home automatically happens after the system starts.

Try set one disk from raid as demage, and check if raid work correctly.

Lesson 5 (user management, file permissions, disk quota)

Test user file: http://seidl.cs.vsb.cz/download/jmena.txt

Practise

Create a script that creates 50 users in your virtualized PC.
Generate and set the primary password for each user.
After the first user logon, please force a new password.
Define disk quotas for all newly created users.

Lesson 6 (networking, iptables)

Practise

Configure your virtual machine so that the "hostonly" interface receives a static IP address after the PC restarts.

Create a startup script that initializes the firewall using iptables.
The default policy for INPUT will be DROP.
Disable all traffic to the server (INPUT), enable only tcp port ports 80 and 443.
Only enable port 22 from defined IPs.

Configure SNAT for all packets coming out of the enp0s3 interface.

Lesson 7 (LAMP, DHCP, NFS)

Install MySQL in debian

https://dev.mysql.com/downloads/repo/apt/
https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/
https://httpd.apache.org/
https://www.isc.org/downloads/dhcp/
http://nfs.sourceforge.net/nfs-howto/ar01s03.html


Practise

 Install on your virtual PC LAMP server and run Mediawiki.


Final Test

Minimum points from Final test is 30. Maximum is 50.
You can use all information source (webpage, own notes, books).
Please, during the test do not use any online communication!
The test lasts 2 hours.

Final Test version A

* ( 5p) Create clear virtual PC and install Debian 11 on virtual PC as small installation (insrtall only ssh package during installation proces)
* (10p) Add next 3 disks and create RAID1 with one SpareDisk
* ( 5p) Format the Raid as EXT4 file system, and mount the RAID as /home directory (correctly edit file /etc/fstab)
* (10p) Write script an bash language, create 100 users, with default pasword a add user quota for all new users
* ( 5p) Create group “share” and add 5 users to this group
* ( 5p) Create directory /share with all permission for group share and set no permission for others
* (10p) Install LAMP server, and run Mediawiki
* (10p) Write script in bash language, set firewall in this script, set default policy in INPUT chain as DROP,
        enable connection to the web server only from defined network
* ( 5p) Create service Firewall and start your script with previous item after computer started

Final Test version B

* ( 5p) Create clear virtual PC and install Debian 11 on virtual PC as small installation (insrtall only ssh package during installation proces)
* (10p) Add next 3 disks and create RAID5 without one SpareDisk
* ( 5p) Format the Raid as EXT4 file system, and mount the RAID as /home directory (correctly edit file /etc/fstab)
* (10p) Write script an bash language, create 100 users, with clear pasword a add user quota for all new users
* ( 5p) Create group “student” and add 5 users to this group
* ( 5p) Create directory /student with all permission for group student and set no permission for others
* (10p) Install LAMP server, and run Mediawiki
* (10p) Write script in bash language, set firewall in this script, set default policy in OUTPUT chain as DROP,
        enable connection to the web server only from 10 defined address
* ( 5p) Create service Firewall and start your script with previous item after computer started