LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   chmod u+s (https://www.linuxquestions.org/questions/slackware-14/chmod-u-s-56197/)

csDraco_ 04-21-2003 10:56 PM

chmod u+s
 
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)

whansard 04-21-2003 11:02 PM

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.

notAcoolNick 04-22-2003 12:20 AM

why don't you do like this?
cat /etc/fstab
...
/dev/cdrom /cdrom iso9660 noauto,ro,user 0 0
/dev/fd0 /mnt/floppy vfat noauto,user,rw 0 2
/dev/scd0 /cdrecord iso9660 noauto,user,ro 0 0

myst 04-22-2003 03:47 AM

the point it's not SUID mount, but add the keyword "user" in /etc/fstab (like the example before)

hungry tom 04-22-2003 04:22 AM

as far as I know, SUID on scripts in linux has no effect because of security reasons...

jharris 04-22-2003 04:52 AM

Quote:

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!

cheers

Jamie...

csDraco_ 04-22-2003 08:44 AM

Quote:

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.

Thank you all for responding :)


All times are GMT -5. The time now is 10:31 PM.