Voici un exemple d’exercice réussi:
Voici comment l’exercice ci-haut s’est déroulé:
$ wget http://gyoukou.ca/vimrc.dot || echo ERREUR
$ mv vimrc.dot ~/.vimrc$ sudo yum install -y epel-release
$ sudo yum install -y meld$ sudo yum groupinstall -y "Development Tools"
$ sudo yum install -y git automake
$ mkdir ~/tmp
$ cd ~/tmp
$ git clone https://github.com/kernc/logkeys.git
$ cd logkeys
$ ./autogen.sh
$ cd build
$ ../configure
$ make
$ sudo make install || echo ERREUR# IMPORTANT: cd ~ pour aller de votre répertoire ~
$ cd ~
$ wget http://gyoukou.ca/atelier_06.tar.gz || echo ERREUR
$ tar zxvf atelier_06.tar.gz
$ cd atelier_06IMPORTANT: ne pas éditer directement le fichier
/etc/default/grub
grub (outil de démarrage)AVANT:
1GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"APRÈS:
1GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap quiet"rhgb désactive le démarrage graphique au profit de l’affichage d’un logrhgb signifie Red Hat Graphical Boot)| Record à battre | Maximum acceptable |
|---|---|
| 4 touches | 9 touches |
$ sh afficher_objectif.sh a01 $ sh exercice_vim.sh a01
/etc/selinux/config
AVANT:
1SELINUX=enforcingAPRÈS:
1SELINUX=disabled| Record à battre | Maximum acceptable |
|---|---|
| 7 touches | 25 touches |
$ sh afficher_objectif.sh a02 $ sh exercice_vim.sh a02
/etc/fstab
AVANT:
1/dev/mapper/centos-tmp /tmp xfs defaults 0 0APRÈS:
/tmp devient un sous-répertoire de / (partition centos-root)| Record à battre | Maximum acceptable |
|---|---|
| 4 touches | 6 touches |
$ sh afficher_objectif.sh a03 $ sh exercice_vim.sh a03
/etc/locale.conf
AVANT:
1LC_TIME=""APRÈS:
1LC_TIME="fr_CA.UTF-8"fr_CA.UTF-8 entre les " afin de définir aussi le format de date| Record à battre | Maximum acceptable |
|---|---|
| 8 touches | 18 touches |
$ sh afficher_objectif.sh a04 $ sh exercice_vim.sh a04
/etc/mime.types
file affiche le type d’un fichierAVANT:
1application/3gpp-ims+xml
2application/activemessage
3application/andrew-insetAPRÈS:
1application/3gpp-ims+xml inconnu
2application/activemessage inconnu
3application/andrew-inset inconnuinconnu pour les trois premiers types de fichier| Record à battre | Maximum acceptable |
|---|---|
| 18 touches | 40 touches |
$ sh afficher_objectif.sh a05 $ sh exercice_vim.sh a05
/etc/hosts
AVANT:
1206.167.24.30 ciboulot.ca
2#172.17.0.30 ciboulot.ca
APRÈS:
1#206.167.24.30 ciboulot.ca
2172.17.0.30 ciboulot.caciboulot.ca| Record à battre | Maximum acceptable |
|---|---|
| 6 touches | 12 touches |
$ sh afficher_objectif.sh a06 $ sh exercice_vim.sh a06
/etc/firewalld/direct.xml
firewall-cmdAVANT:
1 <rule priority="0" table="filter" ipv="ipv4" chain="FORWARD">-i PRIVE -o PUBLIC -j ACCEPT</rule>
2 <rule priority="0" table="filter" ipv="ipv4" chain="FORWARD">-i PUBLIC -o PRIVE -m state --state RELATED,ESTABLISHED -j ACCEPT</rule>
3 <rule priority="0" table="nat" ipv="ipv4" chain="POSTROUTING">-o PUBLIC -j MASQUERADE</rule>APRÈS:
1 <rule priority="0" table="filter" ipv="ipv4" chain="FORWARD">-i 192.168.1.4 -o 10.33.50.3 -j ACCEPT</rule>
2 <rule priority="0" table="filter" ipv="ipv4" chain="FORWARD">-i 10.33.50.3 -o 192.168.1.4 -m state --state RELATED,ESTABLISHED -j ACCEPT</rule>
3 <rule priority="0" table="nat" ipv="ipv4" chain="POSTROUTING">-o 10.33.50.3 -j MASQUERADE</rule>| Record à battre | Maximum acceptable |
|---|---|
| 37 touches | 120 touches |
$ sh afficher_objectif.sh a07 $ sh exercice_vim.sh a07
~/.bashrc
AVANT:
APRÈS:
1alias la="ls -la"| Record à battre | Maximum acceptable |
|---|---|
| 12 touches | 22 touches |
$ sh afficher_objectif.sh a08 $ sh exercice_vim.sh a08
/etc/resolv.conf
AVANT:
1nameserver 10.33.50.1APRÈS:
1nameserver 192.168.1.1192.168.1.1| Record à battre | Maximum acceptable |
|---|---|
| 14 touches | 35 touches |
$ sh afficher_objectif.sh a09 $ sh exercice_vim.sh a09
/etc/ssh/sshd_config
AVANT:
1#X11Forwarding yes
APRÈS:
1X11Forwarding yes| Record à battre | Maximum acceptable |
|---|---|
| 3 touches | 8 touches |
$ sh afficher_objectif.sh a10 $ sh exercice_vim.sh a10
IMPORTANT: ne pas éditer directement le fichier
/etc/ssh/sshd_config
AVANT:
1#X11Forwarding yes
APRÈS:
1X11Forwarding yesa10, sauf que cette fois-ci le curseur n’est pas déjà placé| Record à battre | Maximum acceptable |
|---|---|
| 7 touches | 18 touches |
$ sh afficher_objectif b01 $ sh exercice_vim.sh b01
/etc/default/grub
grub (outil de démarrage)AVANT:
1GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"APRÈS:
1GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap quiet"a01, sauf que le curseur n’est pas déjà placé| Record à battre | Maximum acceptable |
|---|---|
| 8 touches | 20 touches |
$ sh afficher_objectif.sh b02 $ sh exercice_vim.sh b02
/etc/services
AVANT:
1systat 11/tcp users
2systat 11/udp users
3daytime 13/tcp
4daytime 13/udp
5qotd 17/tcp quote
6qotd 17/udp quote
7msp 18/tcp # message send protocol (historic)
8msp 18/udp # message send protocol (historic)
9chargen 19/tcp ttytst source
10chargen 19/udp ttytst source
11ftp-data 20/tcpAPRÈS:
| Record à battre | Maximum acceptable |
|---|---|
| 11 touches | 28 touches |
$ sh afficher_objectif.sh b03 $ sh exercice_vim.sh b03
/etc/passwd
AVANT:
1gnome-initial-setup:x:984:977::/run/gnome-initial-setup/:/sbin/nologin
2tcpdump:x:72:72::/:/sbin/nologin
3avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
4apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologinAPRÈS:
userdel| Record à battre | Maximum acceptable |
|---|---|
| 6 touches | 15 touches |
$ sh afficher_objectif.sh b04 $ sh exercice_vim.sh b04
/etc/group
AVANT:
1wheel:x:10:APRÈS:
1wheel:x:10:mbergeronmbergeron au groupe wheelwheel est le groupe qui peut faire la commande sudo| Record à battre | Maximum acceptable |
|---|---|
| 10 touches | 25 touches |
$ sh afficher_objectif.sh b05 $ sh exercice_vim.sh b05
$ mv ~/.vimrc.bak ~/.vimrc