Files
tp_permission/solution.md

30 lines
725 B
Markdown

## Groupes et utilisateur·trice·s
```bash
groupadd webdev
for i in pierre paul jacquie rose ;do
useradd -m -d /home/${i} -G webdev ${i}
printf "%s:%s" "$i" '123Soleil!' | chpasswd
passwd -x 366 $i
done
```
## Permissions
```bash
# tous les fichiers / répertoires créés dans /var/www/html/client1/ appartiendront au groupe webdev
mkdir -pm 3570 /var/www/html/client1
chown apache:webdev /var/www/html/client1
mkdir -pm 3770 /var/www/html/client1/{www,tmp,logs,cache}
# apache peut lire www
chown apache /var/www/html/client1/www
chmod 3570 /var/www/html/client1/www
# apache peut écrire dans cache et tmp
chown apache /var/www/html/client1/{cache,tmp}
chmod 3770 /var/www/html/client1/{cache,tmp}
```