Table des matières

Permissions

  • 0 : - - - (aucun droit)
  • 1 : - - x (exécution)
  • 2 : - w - (écriture)
  • 3 : - w x (écriture et exécution)
  • 4 : r - - (lecture seule)
  • 5 : r - x (lecture et exécution)
  • 6 : r w - (lecture et écriture)
  • 7 : r w x (lecture, écriture et exécution)

Calculateur Chmod : https://chmodcommand.com

Droits spéciaux

Niveau des permissions dans un serveur web

Au sein d'un serveur web, il est recommandé de mettre 644 pour les fichiers et 755 par défaut pour les dossiers (pour l’exécution : cd ).

Exemple de configuration des permissions dans le projet PrivateBin

#!/bin/sh
# directories of privatebin
pbpath='/var/www/privatebin/'
pbdata='/var/www/privatebin/data/'
# user, of PrivateBin and web server (may be the same, as explained above)
pbuser='php'
htgroup='www-data'
rootuser='root'

mkdir -p "$pbdata"

echo "chmod"
find "${pbpath}" -type f -print0 | xargs -0 chmod 0640
find "${pbpath}" -type d -print0 | xargs -0 chmod 0550
find "${pbdata}" -type f -print0 | xargs -0 chmod 0640
find "${pbdata}" -type d -print0 | xargs -0 chmod 0750

echo "chown"
chown -R ${rootuser}:${htgroup} "${pbpath}/"
chown -R ${pbuser}:${rootuser} "${pbdata}/"

Source : https://github.com/PrivateBin/PrivateBin/wiki/FAQ#what-are-the-recommended-file-and-folder-permissions-for-privatebin

Liens