Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi there,
I have a question relating to SUID special permission.
I wanted to test its functionality and something doesn't work.
without SUID: script runs with the permissions of the user which starts the script
with SUID: the script runs with the permissions of the owner
I did the following test:
1. I have a directory named test (owned by root - 775 permissions) that contains 2 files: bar and foo.
2. bar is an executable file with only one command: rm foo
3. bar is owned by root (permission 4755) - SUID is set
4. foo is owned by root (permission 0400)
5. when a normal user runs bar, it should delete foo because it (bar) runs with the permissions of root (not the normal user which runs it). This happens only if the test directory has the appropiate rights for the normal user. Also if I add "chown user.user ." in doesn't work .
Under this conditions it seems that SUID doesn't work.
Please could any one clarify what I do wrong?
System in FC4.
Afaik suid for shell scripts is disabled in most of linux distributions for security reasons.
Some workarounds are writing a short C wrapper or using sudo (recommended).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.