Ash_Crow
03/03/2009, 11h07
Je viens de remarquer un truc au boulot...
J'autorise l'utilisateur usertest à lancer un certain nombre de commandes, dont mv.
Le chemin précisé est /usr/local/bin/mv.
Testons.
serveurtest:usertest> ls
total 4
drwxr-xr-x 36 root root 1024 Jul 21 2008 ..
-rw-r--r-- 1 root other 0 Mar 3 10:33 foo
drwxr-xr-x 2 root root 512 Mar 3 10:33 .
serveurtest:usertest> mv foo bar
mv: cannot rename foo to bar: Permission denied
Normal.
serveurtest:usertest> sudo mv foo bar
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these two things:
#1) Respect the privacy of others.
#2) Think before you type.
Password:
serveurtest:usertest>
Pas normal, là... Pourtant la commande existe bien. Et elle fonctionne bien. Je vire local/ dans le chemin, ce qui donne : /usr/bin/mv.
serveurtest:usertest> sudo mv foo bar
serveurtest:usertest> ls -l
total 4
drwxr-xr-x 36 root root 1024 Jul 21 2008 ..
-rw-r--r-- 1 root other 0 Mar 3 10:33 bar
drwxr-xr-x 2 root root 512 Mar 3 10:39 .
Ah ben ce coup-ci, ça marche :huh:
Une idée de pourquoi il ne veut pas du premier chemin ? (Pour info, c'est une machine sous SunOS 5.9)
J'autorise l'utilisateur usertest à lancer un certain nombre de commandes, dont mv.
Le chemin précisé est /usr/local/bin/mv.
Testons.
serveurtest:usertest> ls
total 4
drwxr-xr-x 36 root root 1024 Jul 21 2008 ..
-rw-r--r-- 1 root other 0 Mar 3 10:33 foo
drwxr-xr-x 2 root root 512 Mar 3 10:33 .
serveurtest:usertest> mv foo bar
mv: cannot rename foo to bar: Permission denied
Normal.
serveurtest:usertest> sudo mv foo bar
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these two things:
#1) Respect the privacy of others.
#2) Think before you type.
Password:
serveurtest:usertest>
Pas normal, là... Pourtant la commande existe bien. Et elle fonctionne bien. Je vire local/ dans le chemin, ce qui donne : /usr/bin/mv.
serveurtest:usertest> sudo mv foo bar
serveurtest:usertest> ls -l
total 4
drwxr-xr-x 36 root root 1024 Jul 21 2008 ..
-rw-r--r-- 1 root other 0 Mar 3 10:33 bar
drwxr-xr-x 2 root root 512 Mar 3 10:39 .
Ah ben ce coup-ci, ça marche :huh:
Une idée de pourquoi il ne veut pas du premier chemin ? (Pour info, c'est une machine sous SunOS 5.9)