SlackwareThis Forum is for the discussion of Slackware Linux.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I wrote a (u)mount script for myself so that I don't have su as root. I set the file permisions using "chmod u+s a.bash."
But when I execute this script:
"-rwsr-xr-x 1 root users 53 Apr 21 23:25 a.bash"
I still get an error:
"mount: only root can do that"
I also tried g+s, and get the same error.
What am I doing wrong?
(I hope I'm making sense .. it's late at night now)
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
i was messing with the same crap last week.
i ended up setting the suid bit on mount and umount
and still it will only work when i umount specifically
what i had set in fstab with umask=000
like my fstab line has /dev/cdrom on /mnt/cdrom,
but the users still can't
mount /dev/cdrom /mnt /cdrom
they can only
mount /mnt/cdrom
i even made the mount points read-write for all
i don't know if everything i did was necessary or not.
Originally posted by hungry tom as far as I know, SUID on scripts in linux has no effect because of security reasons...
Not just Linux. Most Unix systems won't allow you to SUID/SGID a script for this reason. I've seen people work around this by writing a C program that is SUID which calls the script but its not really a good idea!
Originally posted by hungry tom as far as I know, SUID on scripts in linux has no effect because of security reasons...
Arrrr ... I wish I knew that sooner
But it's interesting to know that chmod u+s works on a compiled program, I'll give a.out a try.
I'm not really interesten in mounting as much as the general application of chmod u+s progs ... since one neat app at my univ. (they use SunOS 5.8) is a submit command, that lets you submit your projects/assignments ... simply copy them to a dir. owned by your prof. While another app works the other way around and lets you read your marks from the profs dir.
"chmo u+s" + C or Java or your_other_fav_programing_lang is an excellent tool for interacting with data in a predefined way.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.