Hallo,
ich lerne bash, wieder, und wieder… Heute versuche ich mit 'setuid' zu spielen, aber es funktioniert mit einem Bash-Script nicht wie erwartet.
Attribute meines mein Bash-Script enthaltenden Ordners:
Code
thierry@toto-PC:~/Documents/Informatik> ll -d ../Informatik/
drwxr-xr-x 2 thierry users 4096 7 déc. 09:33 ../Informatik/
Attribute des Bash-Scripts 'SETUID_prog':
Code
thierry@toto-PC:~/Documents/Informatik> ll SETUID_prog
-rwsr--r-- 1 root root 189 7 déc. 10:15 SETUID_prog
Das Script:
Code
thierry@toto-PC:~/Documents/Informatik> cat SETUID_prog
#!/bin/bash
# Verwendung von 'SETUID', Dateiattribute…
echo "Geben Sie eine Zahl ein:"
read zahl
echo $zahl > zahl.txt
echo "Die Zahl ist $zahl und ist in der Datei zahl.txt gespeichert"
Das Drama:
Code
thierry@toto-PC:~/Documents/Informatik> ./SETUID_prog
bash: ./SETUID_prog: Permission non accordée (keine Erlaubnis…)
Warum darf ich das Script nicht ausführen, obwohl die Dateiattribute vom Script '-rwsr--r-- 1 root root …' sind ?
Gibt es eine Sicherheit, um meine gefährlichen Taten zu vermeiden ?
Danke für Ihre Hilfe,
Thierry.