SystemAdministration Documentation
SystemAdministration Documentation
Gisela Hoxha
Project Overview:In this System Administration project, I undertook the challenge of
setting up a 64-bit Debian Linux server as a virtual machine using Oracle VM VirtualBox. The
project encompassed various tasks, including software installations, user management, sudo
privileges, storage expansion, LAMP stack deployment, web application installation, shell
scripting, cron job implementation, and Docker containerization exploration.
The project initiation involved installing essential software components such as the GNU C++
compiler, nmap, mdadm, gparted, and OpenSSH server. User management was carefully
executed, creating users with specific criteria and assigning sudo privileges. Security
configurations were implemented to ensure controlled access.
Storage expansion was a significant focus, involving the addition of three hard disks, creation of
logical volumes, and formatting using the ext4 filesystem. The deployment of the LAMP stack
included setting up Apache, PHP, and MariaDB, with a unique MariaDB root password.
The installation of a web application added complexity, showcasing adaptability in managing
diverse software. Shell scripting played a crucial role, with scripts created for tasks like sorting
music files based on length. The introduction of cron jobs automated periodic system
maintenance.
Exploring containerization with Docker, I created an image for a simple web app, gaining
insights into modern deployment practices. Adherence to industry best practices and thorough
documentation throughout the project highlighted proficient Linux system administration skills.
This exercise involves setting up a 64-bit Debian Linux virtual machine in VirtualBox with specific
configurations, installing the Xfce desktop environment, and configuring user accounts.
I opened VirtualBox and clicked on "New" the green button that is in the shape of a cross to create a
new virtual machine.
I Selected "Linux" as the type and "Debian (64-bit)" as the version and clicked"Next."
I Selected "VDI (VirtualBox Disk Image)" as the hard disk file type.
I Chose "Dynamically allocated" for storage and I set the size to 25 GB, I clicked “Next” and the Virtual
Machine is created now.
Step 6: Download Debian Netinst ISO
I download the small installation CD (netinst) for Debian 64-bit from this link
(https://www.debian.org/distrib/netinst).
First of all, I selected the newly created virtual machine, then I clicked on "Settings” in the "Storage" tab.
In the "Controller: IDE" section, I clicked on the empty disk icon under "Attributes."
Then, I clicked on the disk icon next to "Optical Drive" and I chose the Debian Netinst ISO file that I
downloaded before.
I selected the virtual machine and clicked "Start” then the Debian installer will be booted from the ISO.
Language and Location: I chose English and as a location I chose my current location.
Configure the Network: I set the hostname to "debian-server”, I left the domain empty.
Set Up Users and Passwords:
Secondly, I created my username in the form "xy" (ghoxha according to my initials I replaced x with G
from my first letter of my given name, and y with Hoxha as my family name) and next I set the password
to "User4321."
Partition Disks:
I chose "Guided - use entire disk,” I selected the virtual hard disk that I created and then I chose "All files
in one partition."
Install the Base System:I chose "Software selection" and deselect everything except "SSH server."
Install the GRUB Boot Loader: I have chosen "Yes" to install GRUB.
TASK2:
Firstly, I opened a terminal in my Debian System.
Step 1: Update Package Lists
(Before installing any software, it's a good practice to update the package lists to ensure that I
have the latest information about available packages.) I updated with this command:
sudo apt update
Task3
I added a new user named "test" with the adduser command.
sudo adduser test --home /home/test_home --shell /bin/sh
This command created a new user named "test" with the specified home directory
(/home/test_home) and shell (/bin/sh).
I set a password for the new user I entered the password "Test4321" as was required in the
question 3.
sudo chown test:test /home/test_home
I used this command to set the owner and group of the /home/test_home directory to "test."
So to adjust the ownership of their home directory.
TASK4
Step 1: Create an Alias for Shells (excluding bash, dash, sh)
I added the following lines to my shell configuration file (e.g., ~/.bashrc):
alias SHELLS='cat /etc/shells | grep -vE "bash|dash|sh"'
I have used this alias cat /etc/shells to list available shells and filters out bash, dash, and sh.
Step 2: Grant sudoer Privileges to "test" for "gparted" and "mdadm"
I edited the sudoers file using the visudo command:
sudo visudo
I added the following lines at the end of the sudoers file to grant "test" user privileges:
test ALL=(ALL:ALL) NOPASSWD: STORAGE_ADMIN
TASK5
Step 1: Add Three Hard Disks in VirtualBox
On VirtualBox I selected my virtual machine Debian-server.
On “Settings”, on the “Storage”, on the "Controller: SATA" section I clicked on the disk icon with
a plus sign to add a new hard disk. I repeated this process three times in order to create three
hard disks, each with a capacity of 250MB.
For each new hard disk, I was prompted to create a new hard disk or use an existing one. I
chose "Create a new disk" then the default VDI (VirtualBox Disk Image), I chose "Dynamically
allocated" and then I set the size 250MB of each virtual hard disk and now they are created.
Step 2: Start the Virtual Machine
Step 3: Partition and Format the Disks
I opened a terminal on my Debian system.
I used the lsblk command to list the available block devices.
Partition the Disks Using parted:
sudo parted /dev/sdb
TASK6
Step 1: Install Apache, PHP, and MariaDB
sudo apt update
sudo apt install apache2 php libapache2-mod-php mariadb-server php-mysql
During the MariaDB installation, it prompted me to set the root password. I set
it as "gisela123".
TASK7
Installing Lime Survey (for student names starting with G-K):
I visited the official Joomla website https://www.limesurvey.org/ and I
downloaded from here the lasted version of it. I uziped the zip file of limesurvey
with this command : sudo unzip limesurvey6.4.3+240122.zip
Next I set permissions to it and put in the html file with this command: sudo chown -R www-
data:www-data /var/www/html/limesurvey.
Next, I opened my web browser and navigated:
http://your_server_ip/path/on/server/limesurvey.
TASK8
STEP 1: I used a text editor like nano to create the script with this command:
nano generate_wordlist.sh
input_wordlist="$1"
number_of_digits="$2"
output_wordlist="$3"
TASK9
Step1: I opened the Crontab for Editing through this code:
crontab -e
Task10
Step 1: Install Docker with this code:
sudo apt update
sudo apt install docker.io
Step 2: Installing Flask
# Install Python3
source venv/bin/activate
Deactivate
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
# Install Docker
FROM python:3.9-alpin
# Set the working directory inside the container
WORKDIR /app
COPY . .
EXPOSE 5000