Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Born2beRoot

A 42 system administration project focused on creating and hardening a Linux virtual machine.

42 badge Topic badge Status badge

Linux, virtualisation, SSH, UFW, sudo, cron, LVM, hardening


Overview

Born2beRoot is a 42 curriculum project that consists of installing and configuring a Linux virtual machine while respecting system administration and security constraints.

The goal is not only to "make a VM work", but also to understand what is being configured, why it is configured that way, and how to explain and defend those choices clearly during the evaluation.

This project mainly helps me work on:

  • virtualization and the role of a virtual machine
  • Linux system administration without a graphical interface
  • securing access, privileges, and services
  • the ability to explain a simple and justified architecture

VM Snapshot

A quick summary of the current setup:

Element Value
Distribution Debian
Hypervisor VirtualBox
Hostname kpourcel42
Main user kpourcel
Required groups sudo, user42
SSH active on port 4242
Root via SSH disabled
Firewall UFW enabled
Monitoring periodic script with cron
Bonus none

Features

  • Linux virtual machine without a graphical interface
  • non-root user created and added to the required groups
  • password policy and sudo rules configured
  • SSH service enabled with root login disabled
  • UFW firewall enabled with explicit rules
  • monitoring script executed periodically
  • documentation useful for the evaluation and manual checks
  • bonus features can be documented later if needed

Concepts Covered

Through this project, I work on the following concepts:

  • difference between a host machine and a virtual machine
  • minimal Linux installation
  • users, groups, permissions, and privilege escalation
  • sudo configuration and related log inspection
  • SSH, network ports, and minimal service exposure
  • firewall management with UFW
  • partitioning and LVM
  • automation with cron
  • evaluation topics related to the chosen distribution: apt / aptitude and AppArmor for Debian, or SELinux / dnf for a RHEL-based distribution depending on the subject version

Repository

This repository does not contain a program to compile. It mainly serves as documentation support for the project.


Usage

Using this project means starting the virtual machine, checking the expected services, and being able to justify each configuration choice.

Verification examples

hostnamectl
getent passwd <login>
id <login>
sudo systemctl status ssh
ss -tuln | grep 4242
sudo ufw status numbered
lsblk -f
sudo crontab -u root -l
ssh <login>@127.0.0.1 -p 4242

Project Constraints

This README follows the constraints commonly associated with Born2beRoot:

  • a Linux virtual machine without a graphical interface
  • a non-root main user present on the machine
  • properly configured administrative groups and privileges
  • an applied password policy
  • SSH active only on the expected port
  • root SSH login disabled
  • an active firewall
  • a hostname matching the expected login format
  • a monitoring script launched periodically
  • a partition layout that can be shown and explained, with LVM depending on the subject

Important note: if your campus uses a different version of the subject, some distributions, bonus parts, or service names may vary. In that case, the official PDF of your subject is the source of truth.


Testing

The project can be checked with a series of simple and reproducible tests:

  • verify that the main user exists and belongs to the correct groups
  • verify that ssh is active and listening on the correct port
  • verify that ufw is active and that the rules are correct
  • verify that sudo logs commands properly
  • verify the hostname
  • verify the partitioning and the presence of LVM if required
  • verify the cron scheduler and the monitoring script frequency

Manual test examples

getent group sudo
getent group user42
sudo systemctl status ssh
sudo ufw status numbered
sudo ls /var/log/sudo
sudo tail -n 20 /var/log/sudo/*
cat /etc/hostname
lsblk
sudo crontab -u root -l

What I Learned

This project helped me improve in several important areas:

  • moving from a "click-and-use" approach to a "configure-and-understand" approach
  • reasoning in terms of services, configuration files, and permissions
  • applying simple system security principles
  • checking a system with precise commands instead of assumptions
  • presenting an architecture clearly during an evaluation

Author

Middle-555
42 student

GitHub

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors