sudo
est SUID qu'il est possible de changer d'utilisateur alors qu'on n'est pas root au départ.700
dans le chmod
, on supprime ces bits !$ ls -lhd / /* drwxr-xr-x 23 root root 4.0K May 11 2013 / drwxr-xr-x 2 root root 4.0K Oct 12 23:47 /bin drwxr-xr-x 4 root root 4.0K Oct 12 23:48 /boot drwxr-xr-x 16 root root 3.5K Dec 2 08:46 /dev drwxr-xr-x 139 root root 12K Nov 30 20:07 /etc drwxr-xr-x 4 root root 4.0K Aug 3 23:47 /home lrwxrwxrwx 1 root root 30 May 11 2013 /initrd.img -> /boot/initrd.img-3.2.0-4-amd64 drwxr-xr-x 17 root root 4.0K Jun 1 2013 /lib drwxr-xr-x 2 root root 4.0K May 11 2013 /lib64 drwx------ 2 root root 16K May 11 2013 /lost+found drwxr-xr-x 4 root root 4.0K Oct 24 22:22 /media drwxr-xr-x 2 root root 4.0K Dec 14 2012 /mnt drwxr-xr-x 3 root root 4.0K May 30 2013 /opt dr-xr-xr-x 220 root root 0 Nov 28 20:37 /proc drwx------ 7 root root 4.0K Sep 8 16:43 /root drwxr-xr-x 24 root root 960 Nov 30 07:40 /run drwxr-xr-x 2 root root 4.0K Oct 18 20:31 /sbin drwxr-xr-x 2 root root 4.0K Jun 10 2012 /selinux drwxr-xr-x 2 root root 4.0K May 11 2013 /srv drwxr-xr-x 13 root root 0 Nov 28 20:37 /sys drwxrwxrwt 9 root root 12K Dec 2 17:17 /tmp drwxr-xr-x 10 root root 4.0K May 11 2013 /usr drwxr-xr-x 11 root root 4.0K May 25 2013 /var lrwxrwxrwx 1 root root 26 May 11 2013 /vmlinuz -> boot/vmlinuz-3.2.0-4-amd64
/tmp
. En gros, ça veut dire que n'importe qui a droit d'écrire dedans, mais on ne peut pas supprimer les fichiers des autres utilisateurs (sauf si on est root). Normalement, si on a les droits d'écriture sur un répertoire, on peut supprimer un fichier dedans même si on n'a pas de droit sur le fichier lui-même.
CHMOD
sur ubuntu... chapeau bas~