SUID not working with shell script
I have created a small shell script with following content.
cat /usr/bin/checksuid.sh
!/bin/bash
echo "Hello" > /etc/myfile.cnf
ls -l /usr/bin/checksuid.sh
-rwsr-xr-x 1 root root 56 Sep 9 12:56 /usr/bin/checksuid.sh
I have also created a file /etc/myfile.cnf with root account and set
permissions as below
-rw-r--r-- 1 root root 6 Sep 9 12:26 /etc/myfile.cnf
When I execute /usr/bin/checksuid.sh from non root account, I get
following error.
/usr/bin/checksuid.sh: line 3: /etc/myfile.cnf: Permission denied
Can some one help you that why SUID is not working.
No comments:
Post a Comment