LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-05-2005, 09:46 AM   #1
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Rep: Reputation: 30
Question fixing mount permissions?


Hi, I changed the permissions on /bin/mount

$ ls -l /bin/mount
-rwxr-xr-x 1 root root 76888 2004-09-24 00:34 /bin/mount

and in the process, i prevented standard users from being able to do mount

$ mount /media/cdrom0
mount: must be superuser to use mount

the pertinant line in /etc/fstab is

/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0

i tried

$ su -c "chmod u+s /bin/mount"

which now allows me to mount, but when i try to unmount, i get

$ mount /media/cdrom0
$ umount /media/cdrom0
umount: /dev/hdc: not mounted
umount: /media/cdrom0: must be superuser to umount
umount: /dev/hdc: not mounted
umount: /media/cdrom0: must be superuser to umount

thanks for any thoughts or assistance.
 
Old 05-05-2005, 10:35 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
well do the same on umount, I mean:
Code:
chmod u+s /bin/umount
 
Old 05-05-2005, 11:33 AM   #3
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
thanks, changing permissions for umount works. i am very concerned that i am opening potential security vulnerabilities. the +s means enable the suid bit, right?
 
Old 05-05-2005, 10:26 PM   #4
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Rather than change the permissions on the executables,
perhaps you could try creating a cdrom group and
adding your user to that group.

eg:
# grep cdrom /etc/group
cdrom:x:24:user1,user2,user3

Then chown root:cdrom /dev/cdrom
# ls -l /dev/dvdrw
lrwxr-xr-x 1 root cdrom 8 Feb 17 15:46 /dev/dvdrw -> /dev/hdc

and make sure fstab has the user option set:
# grep dvdrw /etc/fstab
/dev/dvdrw /media/dvdrw auto ro,user,noauto 0 0

ps. the reason you couldn't umount it as user is because you
mounted it as root.
 
Old 05-06-2005, 07:04 AM   #5
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Quote:
ps. the reason you couldn't umount it as user is because you
mounted it as root.
I don't think so... 'cause his prompt was a "$" and not a "#" which proves that it was executed as user... unless he changed the default root prompt behavior
 
Old 05-06-2005, 08:26 AM   #6
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Sorry, I should have put that a little clearer, and it has nothing to do with the prompt in this case
as the suid bit had been set on mount, but not on umount.
ie. the device is mounted by root.
 
Old 05-06-2005, 10:15 AM   #7
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Quote:
as the suid bit had been set on mount, but not on umount.
ie. the device is mounted by root.
OK
but we could also think that umount is a symlink to mount (that what I thought before checking it was not that and so umount have to also set suid) like modprobe for insmod...
and if you just read mount man page, you see that you just have to add "user" option to mount/umount a partition with the same user... so that may lead to a certain confusion
 
  


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
permissions/mount improverrr Ubuntu 6 12-21-2005 06:55 PM
reset all file permissions, nothing works, need help fixing qwijibow Linux - General 5 06-14-2004 03:17 PM
mount permissions KMcD Slackware 1 02-09-2004 05:48 AM
Fixing MySQL root account permissions. TexasDex Linux - Software 2 02-02-2004 09:39 PM
mount permissions aqoliveira Linux - General 2 01-12-2002 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:21 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration