LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-21-2003, 10:56 PM   #1
csDraco_
Member
 
Registered: Feb 2002
Location: Canada
Distribution: Fedora / CentOS
Posts: 93

Rep: Reputation: 15
Question 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)

Last edited by csDraco_; 04-21-2003 at 10:58 PM.
 
Old 04-21-2003, 11:02 PM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,171

Rep: Reputation: 51
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.
 
Old 04-22-2003, 12:20 AM   #3
notAcoolNick
Member
 
Registered: Apr 2003
Location: Oxford, MA, USA
Distribution: Slackware
Posts: 89

Rep: Reputation: 15
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
 
Old 04-22-2003, 03:47 AM   #4
myst
LQ Newbie
 
Registered: Apr 2003
Distribution: Slackware 9
Posts: 24

Rep: Reputation: 15
the point it's not SUID mount, but add the keyword "user" in /etc/fstab (like the example before)
 
Old 04-22-2003, 04:22 AM   #5
hungry tom
LQ Newbie
 
Registered: Apr 2003
Location: Germany
Posts: 12

Rep: Reputation: 0
as far as I know, SUID on scripts in linux has no effect because of security reasons...
 
Old 04-22-2003, 04:52 AM   #6
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
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...
 
Old 04-22-2003, 08:44 AM   #7
csDraco_
Member
 
Registered: Feb 2002
Location: Canada
Distribution: Fedora / CentOS
Posts: 93

Original Poster
Rep: Reputation: 15
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

Last edited by csDraco_; 04-22-2003 at 08:45 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use Chmod Centinul Linux - Newbie 8 06-30-2005 10:44 AM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 08:53 PM
How do I use chmod? Adan Linux - Newbie 5 09-23-2004 04:57 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM
Chmod gibbylinks Linux - Newbie 1 10-23-2003 11:17 AM


All times are GMT -5. The time now is 05:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration