[ ARCHIVE ] : 2024

[ TITLE    ] : Manage Default Target
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Default target tasks examplesDefault target 1| Set the default target to boot into X Window level (previously level 5). It is simple task configuring systemd properly: # systemctl set-default graphical.target We can also check if it succeeded with: # systemctl get-default Additional comment: Here is the list of all targets in systemd: 0 poweroff.target 1 rescue.target 2 multi-user.targe

[ TITLE    ] : Manage autofs
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Configure autofs task examplesAlways: # dnf install nfs-utils autofs -y # systemctl enable autofs --now# systemctl restart autofs Configure autofs 1| Configure autofs to automount the home directories of netuserX user.| Note theFollowing:| - netuserX home directory is exported via NFS, which is available on classroom.example.com(192.168.1.43)| and your NFS-exports directory is /netdir/netuserX for

[ TITLE    ] : Manage Firewalld
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Manage FirewallMaybe very hard to memorize, so, if needed : # firewall-cmd -h | grep <pattern># firewall-cmd --<TAB> Then ALREADY RELOAD THE CONFIG for APPLY CHANGES: # firewall-cmd --reload Manage Firewall Example 1| Refuse domain 172.25.0.0/16 to access the server. # firewall-cmd --zone=block --add-source=172.25.0.0/16 --permanent# firewall-cmd --reload Manage Firewall Example 2| Rem

[ TITLE    ] : Manage Yum and Repository
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Repository task examplesCreate a repository 1| Add new repositories :| - http://classroom.example.com/rhel8.0/x86_64/dvd/AppStream| - http://classroom.example.com/rhel8.0/x86_64/dvd/BaseOS Do it in console (not remote), if there is no ip or hostname assigned to take remote connectivity. You can do that: # dnf config-manager --add-repo http://classroom.example.com/rhel8.0/x86_64/dvd/AppStream# dnf c

[ TITLE    ] : Manage Script Bash
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Script bash tasks examplesScript bash 1| Create a script file:| - if the paramater is “GM” it outputs “good morning”| - if it is “GN”, it outputs “good night” #!/bin/bash# Vérifie si exactement un argument est fourniif [ $# != 1 ]; then echo "Erreur : Ce script nécessite exactement un argument (GM ou GN)." exit 1fi# Vérifie la valeur de l'argumentif [ "$1" = "GM&quo

[ TITLE    ] : Manage Root Password
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Manage Root PasswordManage Root Password 1SUPPRIMER TOUTES DIRECTIVES console=... puis Ctrl-X. Ajouter init=/bin/bash dans la console de grub On doit obtenir un prompt # en bas d’écran, pensez à taper sur entrée au cas où le terminal soit rempli de messages console.Si l’écran reste noir, vous avez laissé traîner des console=, c’est vrai aussi avec rd.break. # mount -o remount /# /sbin/load_polic

[ TITLE    ] : Manage users groups memberships access ACL
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Users, groups and group memberships tasks examplesCreate users, groups and group memberships 1| Create the following users, groups and group memberships:| - A group named admin.| - A user harry who belongs to admin as a secondary group.| - A user natasha who belongs to admin as a secondary group.| - A user sarah who doesn’t have access to an interactive shell and who’s not a member of admin.| - Th

[ TITLE    ] : Manage Journald
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Manage JournaldConfigure Journald 1| Configure journald to persist between reboots # vim /etc/systemd/journald.conf#Storage=autoStorage=persistent Apply (Seems you need to reboot to seen logs in /var/log/journal): # systemctl restart systemd-journald.service Then verify with journalctl after reboot (1 for 1rst reboot, 2 for second, etc.q): # journalctl -b 1 From man journald.conf: Storage=Cont

[ TITLE    ] : Manage Tuned
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Configure TunedTo keep in mind. If necessary: # yum install tuned -y # systemctl start tuned# systemctl enable tuned To manage tuned, you must use tuned-adm: # tuned-adm <TAB> Configure Tuned 1| Set the recommended tuned profile for your system. # tuned-adm recommend# tuned-adm profile virtual-guest // or whatever profile that it recommends Verify: # tuned-adm active Configure Tuned 2| set

[ TITLE    ] : Manage NTP
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Configure NTPTo keep in mind. If necessary: # yum install chrony -y # systemctl restart chronyd.service# systemctl enable chronyd.service --now # vim /etc/chrony.conf Configure NTP 1| Configure your system so that it is an NTP pool of 2.centos.pool.ntp.org NTP is a service that is using chrony deamon. It should be already installed in the system but it does not cost You to issue: # yum install -y

[ TITLE    ] : Manage Find Grep Tar link
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Manage FindTo keep in mind.Execute a simply find command in order to display the result in the terminal: # find / -user harry If it seems ok, you can use exec <cmd> {} <target> \; after: # find / -user harry -exec cp -rf {} /root/find.user \; Manage Find 1| Find all files owned by harry and copy them to /root/find.user| Find files (not subdirectories) owner by user

[ TITLE    ] : Manage Cron Job
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Cron job tasksTo keep in mind: # systemctl status crond.service# systemctl enable crond.service# systemcdl restart crond.service Fin the full path by using the which command and use it in the crontab: # which <cmd> Exemple: # which echo/usr/bin/echo Files to check: # cat /var/log/cron // it shows list of cronjobs# cat /etc/crontab // it shows how cronjob works Cron job 1| Set a Cron

[ TITLE    ] : Manage networking and hostname
[ CATEGORY ] : //
[ DATE     ] :

TIPS & TRICKSTo search the contents of the man pages # man -k searchterm # man -K searchterm Manage networkingManage networking Example 1| Assign hostname and ip address for your virtual machine.| - Hostname: servera.lab.example.com| - Ip address: 192.168.1.42| - Mask: 255.255.255.0| - Gateway: 192.168.1.1| - NameServer: 192.68.1.200 On console (not remote console) : # hostnamectl set-hostname servera.lab.example.com# hostnamectl Note the interface with the ethernet type: # nmcli connectio