Les droits de / ?

Bonjour tout le monde.

GROS problème : je viens de découvrir à l’instant que j’ai apparemment tous les droits en tant que simple utilisateur sur la racine ! Jugez plutôt ce que me renvoie ls -l sur / :

drwxr-xr-x 2 root root 4096 2007-07-12 12:54 bin drwxr-xr-x 3 root root 4096 2007-07-10 18:52 boot lrwxrwxrwx 1 root root 11 2007-03-31 12:50 cdrom -> media/cdrom drwxr-xr-x 14 root root 4500 2007-07-16 21:03 dev drwxr-xr-x 132 root root 12288 2007-07-16 21:01 etc drwxr-xr-x 3 root root 4096 2007-06-05 16:25 home drwxr-xr-x 2 root root 4096 2007-03-31 12:51 initrd lrwxrwxrwx 1 root root 28 2007-03-31 14:54 initrd.img.old -> boot/initrd.img-2.6.18-4-486 drwxr-xr-x 15 root root 12288 2007-07-16 19:03 lib drwx------ 2 root root 16384 2007-03-31 12:49 lost+found drwxr-xr-x 6 root root 4096 2007-07-16 21:00 media drwxr-xr-x 2 root root 4096 2006-10-28 16:06 mnt drwxr-xr-x 4 root root 4096 2007-06-15 08:48 opt dr-xr-xr-x 124 root root 0 2007-07-16 22:59 proc drwxr-xr-x 25 root root 4096 2007-07-16 21:12 root drwxr-xr-x 2 root root 4096 2007-07-16 19:03 sbin drwxr-xr-x 2 root root 4096 2007-03-07 23:56 selinux drwxr-xr-x 2 root root 4096 2007-03-31 12:51 srv drwxr-xr-x 11 root root 0 2007-07-16 22:59 sys drwxrwxrwt 10 root root 4096 2007-07-16 21:12 tmp drwxr-xr-x 13 root root 4096 2007-06-22 16:22 usr drwxr-xr-x 15 root root 4096 2007-05-13 14:46 var lrwxrwxrwx 1 root root 25 2007-03-31 14:54 vmlinuz.old -> boot/vmlinuz-2.6.18-4-486

  • Quels sont les droits « habituels » de / ?
  • Un simple chmod [ce qu’il faut] [les bons fichiers] en root suffira-t-il à régler le problème ?
  • (subsidiaire) Vous avez une idée de ce qui a pu aboutir à ça ??

PS : mon fstab a l’air normal :

proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 /dev/hda2 /media/win ntfs noatime,ro,user,defaults,umask=000 0 0 /dev/hda4 / ext3 noatime,defaults,errors=remount-ro 0 1 /dev/hda6 /media/transit vfat noatime,rw,user,defaults,umask=000,utf8 0 0 /dev/hda5 none swap sw 0 0 /dev/hdb /media/cdrom0 udf,iso9660 user,noauto 0 0

J’ai pas “mieux”

Sur une arborescence sans pouvoir y ajouter de fichier et lire les fichier eux même tu fais pas grand chose

Bonjour,

Ou est le problème ?
Il n’y a que le droit d’exécution qui est autorisé pour l’utilisateur.

Si ça peut te rassurer :

dimm@mambo:/$ ls -l / total 88 drwxr-xr-x 2 root root 4096 2007-03-31 12:38 bin drwxr-xr-x 3 root root 4096 2007-05-15 19:36 boot lrwxrwxrwx 1 root root 11 2007-03-04 13:10 cdrom -> media/cdrom drwxr-xr-x 13 root root 4220 2007-07-16 18:56 dev drwxr-xr-x 3 root root 4096 2007-03-04 15:22 emul drwxr-xr-x 110 root root 12288 2007-07-16 21:22 etc drwxr-xr-x 4 root root 4096 2007-07-16 20:45 home drwxr-xr-x 2 root root 4096 2007-03-04 13:13 initrd lrwxrwxrwx 1 root root 27 2007-03-04 17:43 initrd.img -> boot/initrd.img-2.6.18-dimm lrwxrwxrwx 1 root root 30 2007-03-04 13:14 initrd.img.old -> boot/initrd.img-2.6.18-4-amd64 drwxr-xr-x 15 root root 4096 2007-04-12 22:28 lib lrwxrwxrwx 1 root root 20 2007-04-12 22:28 lib32 -> /emul/ia32-linux/lib lrwxrwxrwx 1 root root 4 2007-03-04 13:13 lib64 -> /lib drwx------ 2 root root 16384 2007-03-04 11:55 lost+found drwxr-xr-x 7 root root 4096 2007-04-24 16:00 media drwxr-xr-x 5 root root 4096 2007-04-24 11:43 mnt drwxr-xr-x 2 root root 4096 2007-03-04 13:13 opt dr-xr-xr-x 92 root root 0 2007-07-16 18:54 proc drwxr-xr-x 8 root root 4096 2007-07-16 18:49 root drwxr-xr-x 2 root root 4096 2007-07-15 18:06 sbin drwxr-xr-x 2 root root 4096 2007-03-04 13:13 srv drwxr-xr-x 11 root root 0 2007-07-16 18:54 sys drwxrwxrwt 8 root root 4096 2007-07-16 20:43 tmp drwxr-xr-x 11 root root 4096 2007-04-12 22:28 usr drwxr-xr-x 14 root root 4096 2007-04-16 20:48 var lrwxrwxrwx 1 root root 24 2007-03-04 17:43 vmlinuz -> boot/vmlinuz-2.6.18-dimm lrwxrwxrwx 1 root root 27 2007-03-04 13:14 vmlinuz.old -> boot/vmlinuz-2.6.18-4-amd64

[quote=“swiip81”]J’ai pas “mieux”

Sur une arborescence sans pouvoir y ajouter de fichier et lire les fichier eux même tu fais pas grand chose[/quote]

Tu es sûr ? Parce que là je peux copier, coller, supprimer n’importe quel fichier de / directement… Ça m’paraît étrange ça non ? Ou alors c’est moi qui déraille… lol

Tu n’aurais pas installé un pilote de chez Samsung par hasard ?
Regarde ce qui peut arriver :http://linuxfr.org/forums/15/22562.html

talogue

Ouais justement j’ai tout de suite pensé à ça, mais j’ai rien installé « hors des dépôts classiques » récemment, donc je ne vois pas. De plus, mon ls -l semble correct, mais je ne crois pas que pouvoir supprimer directement dans nautilus par exemple soit en accord avec les droits annoncés :confused:

Tu utilises sudo ?

non, su.

Merci de continuer « la discut’ » avec moi, parce que j’ai l’impression que j’bile inutilement lol :wink:

tu bile vraiment inutilement, tes droits sont normaux.
essaye ne serait ce que de faire un touch /toto ou un touch /bin/toto, et relis man chmod, tu comprendras peut être mieux les droits. :laughing:

Soit.

C’est juste que je n’me souviens pas avoir vu des « petits cadenas » sur les icônes des dossiers la dernière fois que j’suis passé faire un tour dans /, alors j’pensais que les droits avaient été modifiés…

C’est tout ce qu’il y a de plus normal que en tant qu’utilisateur tu puisse lire et exécuter des programes, ce qui veut dire que tu peut les copier dans ton répertoire hoem et en faire ce que tu veux.

Pour rapperl les droits se divise en trois partie:

root:root         RWX | R-X    | R-X
user:group   proprio | group | other

Donc en tant que simple utilisateurs se sera les droits de ‘other’ qui te seront attribué vu que tu n’est pas root, et tu ne fait pas partie de son groupe. ( R=read (4) ; W= write (2); X= execute(1) )

Ouais, justement : je ne dois pas pouvoir écrire, mais je peux créer un fichier texte vierge dans / par exemple… :open_mouth:

[quote=“mattotop”]touch /toto[/quote] Bah je peux le faire, ça crée un fichier vide sans problème

[quote=“mattotop”]touch /bin/toto[/quote]mais là j’peux pas…

alors ça, le touch /toto qui passe (en user, tu es sûr ?) c’est totalement anormal:

[quote]console@MAT64LIN:/usr/bin$ touch /toto
touch: cannot touch `/toto’: Permission denied
console@MAT64LIN:/usr/bin$ ls -la /
total 80
drwxr-xr-x 21 root root 4096 Jun 5 12:05 .
drwxr-xr-x 21 root root 4096 Jun 5 12:05 …
drwxr-xr-x 2 root root 4096 May 31 10:19 bin
drwxr-xr-x 3 root root 4096 Jul 12 10:51 boot
drwxr-xr-x 18 root root 14080 Jul 16 09:50 dev
drwxr-xr-x 3 root root 4096 Jun 28 2006 emul
drwxr-xr-x 121 root root 8192 Jul 16 10:16 etc
drwxrwsr-x 4 root staff 4096 Jun 23 2006 home
lrwxrwxrwx 1 root root 35 May 22 10:29 initrd.img -> boot/initrd.img-2.6.21-custom-em64t
drwxr-xr-x 16 root root 8192 Jul 2 13:04 lib
lrwxrwxrwx 1 root root 20 Jun 5 12:05 lib32 -> /emul/ia32-linux/lib
lrwxrwxrwx 1 root root 4 Jun 5 12:05 lib64 -> /lib
drwx------ 2 root root 4096 Jun 28 2006 lost+found
drwxr-xr-x 3 root root 4096 Jul 16 09:50 media
drwxr-xr-x 6 root root 4096 May 15 11:16 mnt
drwxr-xr-x 3 root root 4096 Jul 3 09:57 opt
dr-xr-xr-x 135 root root 0 Jul 16 09:50 proc
drwxr-xr-x 15 root root 4096 May 7 11:02 root
drwxr-xr-x 2 root root 4096 Jun 7 10:21 sbin
drwxr-xr-x 2 root root 4096 Jun 23 2006 srv
drwxr-xr-x 11 root root 0 Jul 16 09:50 sys
drwxrwxrwt 12 root root 4096 Jul 17 10:33 tmp
drwxr-xr-x 13 root root 4096 Jun 5 12:05 usr
drwxr-xr-x 16 root root 4096 Apr 11 10:04 var
lrwxrwxrwx 1 root root 32 May 22 10:29 vmlinuz -> boot/vmlinuz-2.6.21-custom-em64t
[/quote]

Bah oui, malheureusement j’suis sûr (d’où ma question !) :

debbie@debian:~$ touch /toto debbie@debian:~$ ls -la / total 104 drwxrwxrwx 22 root root 4096 2007-07-17 10:40 . drwxrwxrwx 22 root root 4096 2007-07-17 10:40 .. drwxr-xr-x 2 root root 4096 2007-07-12 12:54 bin drwxr-xr-x 3 root root 4096 2007-07-10 18:52 boot lrwxrwxrwx 1 root root 11 2007-03-31 12:50 cdrom -> media/cdrom drwxr-xr-x 14 root root 4500 2007-07-17 09:36 dev drwxr-xr-x 132 root root 12288 2007-07-17 10:33 etc drwxr-xr-x 3 root root 4096 2007-06-05 16:25 home drwxr-xr-x 2 root root 4096 2007-03-31 12:51 initrd lrwxrwxrwx 1 root root 28 2007-03-31 14:54 initrd.img.old -> boot/initrd.img-2.6.18-4-486 drwxr-xr-x 15 root root 12288 2007-07-16 19:03 lib drwx------ 2 root root 16384 2007-03-31 12:49 lost+found drwxr-xr-x 6 root root 4096 2007-07-17 09:34 media drwxr-xr-x 2 root root 4096 2006-10-28 16:06 mnt drwxr-xr-x 4 root root 4096 2007-06-15 08:48 opt dr-xr-xr-x 126 root root 0 2007-07-17 11:33 proc drwxr-xr-x 25 root root 4096 2007-07-16 21:12 root drwxr-xr-x 2 root root 4096 2007-07-16 19:03 sbin drwxr-xr-x 2 root root 4096 2007-03-07 23:56 selinux drwxr-xr-x 2 root root 4096 2007-03-31 12:51 srv drwxr-xr-x 11 root root 0 2007-07-17 11:33 sys drwxrwxrwt 12 root root 4096 2007-07-17 10:37 tmp -rw-r--r-- 1 debbie debbie 0 2007-07-17 10:40 toto drwxr-xr-x 13 root root 4096 2007-06-22 16:22 usr drwxr-xr-x 15 root root 4096 2007-05-13 14:46 var lrwxrwxrwx 1 root root 25 2007-03-31 14:54 vmlinuz.old -> boot/vmlinuz-2.6.18-4-486

D’ailleurs les deux premières lignes confirment mes craintes…

En revanche, ça c’est bon :

debbie@debian:~$ touch /bin/toto touch: ne peut faire un touch sur `/bin/toto': Permission denied

bon, ben pourquoi c’est comme ça, mistère…
pour corriger:

chmod 0755 / surtout pas en -R

debbie@debian:~$ su Password: debian:/home/debbie# chmod 0755 / debian:/home/debbie# exit exit debbie@debian:~$ ls -la / total 104 drwxr-xr-x 22 root root 4096 2007-07-17 10:44 . drwxr-xr-x 22 root root 4096 2007-07-17 10:44 .. drwxr-xr-x 2 root root 4096 2007-07-12 12:54 bin drwxr-xr-x 3 root root 4096 2007-07-10 18:52 boot lrwxrwxrwx 1 root root 11 2007-03-31 12:50 cdrom -> media/cdrom drwxr-xr-x 14 root root 4500 2007-07-17 09:36 dev drwxr-xr-x 132 root root 12288 2007-07-17 10:33 etc drwxr-xr-x 3 root root 4096 2007-06-05 16:25 home drwxr-xr-x 2 root root 4096 2007-03-31 12:51 initrd lrwxrwxrwx 1 root root 28 2007-03-31 14:54 initrd.img.old -> boot/initrd.img-2.6.18-4-486 drwxr-xr-x 15 root root 12288 2007-07-16 19:03 lib drwx------ 2 root root 16384 2007-03-31 12:49 lost+found drwxr-xr-x 6 root root 4096 2007-07-17 09:34 media drwxr-xr-x 2 root root 4096 2006-10-28 16:06 mnt drwxr-xr-x 4 root root 4096 2007-06-15 08:48 opt dr-xr-xr-x 125 root root 0 2007-07-17 11:33 proc drwxr-xr-x 25 root root 4096 2007-07-16 21:12 root drwxr-xr-x 2 root root 4096 2007-07-16 19:03 sbin drwxr-xr-x 2 root root 4096 2007-03-07 23:56 selinux drwxr-xr-x 2 root root 4096 2007-03-31 12:51 srv drwxr-xr-x 11 root root 0 2007-07-17 11:33 sys drwxrwxrwt 12 root root 4096 2007-07-17 10:47 tmp drwxr-xr-x 13 root root 4096 2007-06-22 16:22 usr drwxr-xr-x 15 root root 4096 2007-05-13 14:46 var lrwxrwxrwx 1 root root 25 2007-03-31 14:54 vmlinuz.old -> boot/vmlinuz-2.6.18-4-486

OK c’est tout bon.

Merci à tous, même si ça semblait normal au premier abord :laughing: