https://training.linuxfoundation.org/certification/linux-foundation-certified-sysadmin-lfcs/
Upcoming Program Changes (estimated late November 2022)
Essential Commands (25%)
Search for files
|
|
Evaluate and compare the basic file system features and options
Compare and manipulate file content
Pour la comparaison de fichier
|
|
Use input-output redirection (e.g. >, », |, 2>)
- stdin 0: standard input
- stdout 1: standard output
- stderr 2: standard error
|
|
Analyze text using basic regular expressions
|
|
Archive, backup, compress, unpack, and uncompress files
Create, delete, copy, and move files and directories
|
|
Create and manage hard and soft links
Pour avoir toutes les informations liés d’un fichier il y a la commande: stat fichier
TODO: faire un description des inodes
hard links

only hard link to files, not folders only hard link to files on the same filesystem
soft links

List, set, and change standard file permissions
user group other
- rwx rwx rwx
d - directory /- regular file c - caractère device l - link s - socket file p - pipe b - block device
remarque: lecture de droit de gauche à droite
revoir le chmod = un intérêt
|
|
Read, and use system documentation
ls --help
|
|
option du man
- 1 Programmes exécutables ou commandes de l’interpréteur de commandes (shell)
- 2 Appels système (fonctions fournies par le noyau)
- 3 Appels de bibliothèque (fonctions fournies par les bibliothèques des programmes)
- 4 Fichiers spéciaux (situés généralement dans /dev)
- 5 Formats des fichiers et conventions. Par exemple /etc/passwd
- 6 Jeux
- 7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7), man-pages(7)
- 8 Commandes de gestion du système (généralement réservées a root)
- 9 Sous-programmes du noyau [hors standard]
|
|
Manage access to the root account
|
|
Operation of Running Systems (20%)
Boot, reboot, and shut down a system safely
Boot or change system into different operating modes
Install, configure and troubleshoot bootloaders
Diagnose and manage processes
TO DO: voir a quoi correspond les colonnes des commandes ps et top
|
|
ctrl + Z background
Locate and analyze system log files
rsyslog - rocket-fast system for log processing
|
|
Schedule tasks to run at a set date and time
crontab
match all possible value *
match multiple value = , (15,45)
range of value - (2-4)
path de la commande
- e -u
- r remove
- r -u user
cp test /etc/cron.hourly/
anacron
/etc/anacron
anacron -T pour tester le fichier de conf
at 15:00
at 'August 20 2022'
at 2:30 August 20 2022
at 'now + 30 minutes'
commande qui n’existe pas
atq ??
atrm 20 ??
Les logs de cron sont dans: /var/log/cron
anacron -n (now)
at 'now +1 minute'
echo 'toto test' | systemd-cat --identifier=at_scheduled_backup
sudo grep atd /var/log/cron
journalctl | grep at_scheduled backup
Verify completion of scheduled jobs
Update software to provide required functionality and security
|
|
Verify the integrity and availability of resources
|
|
Verify the integrity and availability of key processes
Change kernel runtime parameters, persistent and non-persistent
|
|
Use scripting to automate system maintenance tasks
|
|
Manage the startup process and services (In Services Configuration)
init - initialization system
- service
- socket
- device
- timer
man systemd.service
|
|
List and identify SELinux/AppArmor file and process contexts
ls -Z
- unconfined_u user
- object_r role
- user_home_t type
- s0 level
- only certain users can enter certain roles and certain types
- it lets authorized users and process do their job, by granting the permissions they need
- authorized set of actions
- everything else is denied
ps axZ
semanage login -l
getenforce enforcing | permissive | disabled
Manage Software
Identify the component of a Linux distribution that a file belongs to
User and Group Management (10%)
Create, delete, and modify local user accounts
Les informations sur les utilisateurs sont dans les fichiers suivants:
- /etc/passwd
- /etc/group
- /etc/shadow
- /etc/login.defs: Configuration control definitions for the login package
- /etc/skel
|
|
Create, delete, and modify local groups and group memberships
groupadd dev
gpasswd --add john dev
groups john
gpasswd -d dev john
usermod -g dev john
usermod -g groupe principal
usermod -G groupe secondaire
groupmod --new-anem programs dev (-n)
groupdel programs
usermod --gid john john
groupdel programs
Manage system-wide environment profiles
ls -a /etc/skel
printenv=env
HISTSIZE=20000
sudo nano -w /etc/hosts
/etc/environment
/etc/profile.d/lastlogin.sh
echo "tour last login was at: "> $HOME/lastlogin
Manage template user environment
Configure user resource limits
/etc/security/limits.conf
hard limit c’est 30 process
soft c’est 20 process
nproc 30 fsize 1024 (kilobyte) cpu 1
trinity - nproc 3
ulimit -a ??
Manage user privileges
gpasswd -a trinity wheel
gpasswd -d trinity wheel
visudo - permet d’éditer le fichier /etc/sudoers
Remarque: les users qui sont dans le groupe %wheel groupe sudo
- all host
- (all) run as user
- all command
sudo -u trinity ls /home/trinity
|
|
Configure PAM
PAM - ??
ls /etc/pam.d
ls /etc/pam.d/su
man pam.conf
man pam…
Networking (12%)
Configure networking and hostname resolution statically or dynamically
|
|
Configure network services to start automatically at boot
|
|
Implement packet filtering
il y a plusieurs zone dans firewalld. La zone drop est le plus restrictif et la zone trust est la plus permissive.
|
|
Start, stop, and check the status of network services
|
|
Statically route IP traffic
|
|
Synchronize time using other network peers
|
|
Service Configuration (20%)
Configure a caching DNS server
dnf install bind bind-utils && systemctl start named && systemctl enable named && firewall-cmd --add-service=dns
/etc/named.conf
|
|
dig @localhost google.com
Maintain a DNS zone
ls /etc/named.conf
|
|
Les fichiers template sont dans le repertoire /var/named/
faire un fichier /var/named/example.com.zone
revoir la notions des types d’entrée DNS
|
|
systemctl restart named
dig @localhost exemple.com ANY
Configure email aliases
dnf install postfix && systemctl start postfix && systemctl enable postfix
sendmail aaron@localhost <<< "Test mail"
cat /var/spool/mail/aaron
/etc/aliases
|
|
newaliases ??
Configure SSH servers and clients
/etc/ssh/sshd_config
man sshd_config
pour faire des exceptions pour un users
|
|
~/.ssh/config (chmod 600)
~/.ssh/authorized_keys (chmod 600)
~/.ssh/known_hosts
ssh-keygen
ssh-copy-id
ssh_config.d/99-our-settings.conf pour setup le ssh …
Restrict access to the HTTP proxy server
a voir …
dnf install squid
/etc/squid
|
|
Configure an IMAP and IMAPS service
dnf install dovecot systemctl start dovecot && systemctl enable dovecot
/etc/dovecot/dovecot.conf - fichier de configuration
|
|
/etc/dovecot/conf.d/...
10-master.conf - pour la configuration des ports
revoir la liste des ports mails …
/etc/dovecot/conf.d/10-mail.conf
|
|
/etc/dovecot/conf.d/10-ssl.conf
|
|
Query and modify the behavior of system services at various operating modes
Configure an HTTP server
a voir sur web ou/et DA …
dnf install httpd
vim /etc/httpd/conf/httpd.conf
Configure HTTP server log files
à revoir
|
|
Configure a database server
dnf install mariadb && systemctl start mariadb && systemctl enable mariadb
mysql_secure_installation -
mysql -u root - connection à la BDD
/etc/my.cnf.d/mariadb-server.cnf - fichier de configuration du server
Restrict access to a web page
pas suivi
Manage and configure containers
dnf install podman
vim /etc/containers/registries.conf
unqualified-search-registries=["docker.io"] - commenter la ligne avec toute les registries et mettre cette ligne
touch /etc/containers/nodocker - change la commande podman en docker
docker search nginx - faire une recherche sur les registries
docker rmi nginx:latest - supprime l’image nginx
docker run -d nginx - démarre un container en mode détaché
docker container list - liste tout les containers
docker stop container_id - arrête un container
docker ps --all
docker run -d -p 8080:80 --name mysite nginx - container web avec le ports 80 ouvert sur 8080
nc localhost 8080 - vérification
Manage and configure Virtual Machines
dnf install libvert
vim testmachine.xml
|
|
virsh define testmachine.xml
virsh undefine TestMachine --remove-all-storage
virsh help - liste toutes les commandes
virsh list --all
virsh start TestMachine
virsh reboot TestMachine
virsh reset TestMachine
virsh shutdown TestMachine
virsh destroy TestMachine
virsh autostart TestMachine
virsh autostart --disable TestMachine
virsh dominfo TestMachine
virsh setvcpus TestMachine 2 --config --maximum
virsh setvcpus TestMachine 2 --config
virsh setmaxmem TestMachine 2048M --config
Storage Management (13%)
List, create, delete, and modify physical storage partitions
lsblk - voir toutes les partitions
fdisk --list /dev/sda - voir les partitions d’un disque
cfdisk /dev/sdb
- select label type
- gpt
- dos
- sgi
- sun
- create | delete | change type partition (gui)
Manage and configure LVM storage
man lvm
lvmdiskscan
pvcreate /dev/sdc /dev/sdd
pvs
vgcreate my_volume /dev/sdc /dev/sdd
pvcreate
vgextend my_volume /dev/sde
vgs
vgreduce my_volume /dev/sde
lvcreate --size 2G --name partition1 my_volume
vgs
lvcreate --size 2G --name partition2 my_volume
lvs
lvresize --extents 100%VG my_volume/partition1
lvreseize --size 2G my_volume/partition1
lvdisplay
mkfs.xfs /dev/my_volume/partition1
lvresize --resizefs --size 3g my_volume/partition1
Create and configure encrypted storage
|
|
Configure systems to mount file systems at or during boot
|
|
Configure and manage swap space
swapon --show
mkswap /dev/vdb3
swapon --verbose /dev/vdb3
swapoff
dd if=/dev/zero of=/swap bs=1M count=128 status=progress
Create and manage RAID devices
- RAID 0 straight
- RAID 1 Miroring
- raid 5
- RAID 10
mdadm --zero-superblock /dev/sdc /dev/sdd /dev/sde
mdadm --create /dev/md0 --level=0 --raid-device=3 /dev/sdc /dev/sdd /dev/sde
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc /dev/sdd --spare-device=1 /dev/sde
mdadm --stop /dev/md0
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc /dev/sdd
mdadm --manage /dev/md0 --add /dev/vde
cat /proc/mdstat
mdadm --manage /dev/md0 --remove /dev/vde
Configure systems to mount file systems on demand
|
|
/- dans le fichier auto.master veux dire …
Create, manage and diagnose advanced file system permissions
getfacl examplefile
setfacl --modify user:aaron:rw examplefile
setfacl --modify mask:r examplefile
setfacl --modify group:wheel:rw examplefile
setfacl --modify user:aaron:--- examplefile
setfacl --remove user:aaron examplefile
setfacl --remove group:wheel examplefile
setfacl --recursive -m user:aaron:rwx dir1/
setfacl --recursive --remove user:aaron dir1/
man chattr
chattr +a newfile
chattr -a newfile
chattr +i newfile
chattr -i newfile
lsattr
Setup user and group disk quotas for filesystem
dnf install quota
/dev/sda /mybackups/ usrquota,grpquota
quotacheck --create-files --user --group /dev/sdb aquatoa.group aquota.user
quotaon /dev/sdb
fallocate --lenght 100M /mybackups/aaron/100Mfile
edquota --user aaron
quota --user aaron
il peux avoir dépacement mais au bou de x jours delete
fallocate --length 40M /mybackups/aaron/40Mfile
quota --edit-period
Create and configure file systems
mkfs.xfs -L "BackupVolume" -i size=512 /dev/sdb1
xfs_admin -l /dev/sdb1- retourne les information du volume
xfs_admin -L "Backup_Volume" /dev/sdb1 - modifie le label
mkfs.ext4 /dev/sdb1 -L "Backupvolume" -N 5000000 /dev/sdb2
tune2fs -l /dev/sdb2
tune2fs -L /dev/sdb2
filesystem features and options
|
|