LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 02-07-2007, 06:56 PM   #1
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 666

Rep: Reputation: 39
can't mount if user is among a random group


hi everyone,
i have this situation and i do not know where im thinking wrongly.

up until now, i have te following entry in my fstab file:
/dev/sdb1 /mnt/memstick auto noauto,owner,users,rw 0 0

so users of te groups 'users' can mount a flash device.

to keep things nice and clean i decided to add a group 'flash' who's members will have access to a flash memory. so as to restrict some members of the group 'users' to have access to the memory stick.

so i replaces the word 'users' in the fstab entry shown above with 'flash' (from te group) and i also chgrp of /dev/sdb1 to flash. i thought that would do it but it didn't.. what am i forgeting?
nass
 
Old 02-07-2007, 07:09 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I can't get to a box here to check this on, but the following /etc/fstab entry should work since the group option is the one to specify that group membership must be checked:
Code:
/dev/sdb1 /mnt/memstick auto noauto,group,rw 0 0
 
Old 02-08-2007, 02:04 PM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
That entry in fstab isn't for the group 'users'. Notice that you can use 'user' as well. Using 'user' in fstab options means that only the smae person who mounted the device can unmount it. If yopu use 'user' then anyone can unmount it. If you want to control access to the device in fstab, try using uid= or gid= in the options.
 
Old 02-09-2007, 04:38 AM   #4
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 666

Original Poster
Rep: Reputation: 39
yes, in the end
Code:
/dev/flash   /mnt/memstick    auto    noauto,owner,group,rw      0   0
did the work.where:
Code:
root@meditSea:/# ls -l /dev/flash
lrwxrwxrwx  1 root flash 9 2007-02-09 12:33 /dev/flash -> /dev/sdb1
and
Code:
root@meditSea:/# ls -l /dev/sdb1
brw-rw----  1 root flash 8, 17 1995-04-29 13:34 /dev/sdb1
similarly for the cdrom
Code:
/dev/cdrom    /mnt/cdrom   auto   noauto,owner,group,ro  0   0
with:
Code:
root@meditSea:/# ls -l /dev/cdrom
lrwxrwxrwx  1 root cdrom 8 2007-02-03 15:32 /dev/cdrom -> /dev/hda
root@meditSea:/# ls -l /dev/hda
brw-rw----  1 root cdrom 3, 0 2002-06-09 22:27 /dev/hda
i didn't more into uid and gid features as its a home computer and i won't be needing the additional hassle

thank you boht your help.
nass
 
Old 02-09-2007, 05:48 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
What you decribe works when you put each user in the group that owns the device. then the owner(root) or any mamber of that group can mount unmount.
Usually for home systems you'd just use 'user' or 'users' to give users access.
 
Old 02-09-2007, 08:21 AM   #6
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Rep: Reputation: Disabled
If you are using a 2.4 series kernel, quit reading, but making your own links with a 2.6 series kernel will fail when the system is rebooted, because /dev is is ram based & not persistent from session to session. You need to write a new udev rule to cover your requirements, or just use "users", as gnashley has suggested.
Regards,
Bill
 
Old 02-11-2007, 01:27 AM   #7
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by nass
hi everyone,
i have this situation and i do not know where im thinking wrongly.

up until now, i have te following entry in my fstab file:
/dev/sdb1 /mnt/memstick auto noauto,owner,users,rw 0 0

so users of te groups 'users' can mount a flash device.

to keep things nice and clean i decided to add a group 'flash' who's members will have access to a flash memory. so as to restrict some members of the group 'users' to have access to the memory stick.

so i replaces the word 'users' in the fstab entry shown above with 'flash' (from te group) and i also chgrp of /dev/sdb1 to flash. i thought that would do it but it didn't.. what am i forgeting?
nass

See http://slackwiki.org/Windows_Partitions

RW
 
Old 02-14-2007, 02:30 AM   #8
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 666

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by TSquaredF
If you are using a 2.4 series kernel, quit reading, but making your own links with a 2.6 series kernel will fail when the system is rebooted, because /dev is is ram based & not persistent from session to session. You need to write a new udev rule to cover your requirements, or just use "users", as gnashley has suggested.
Regards,
Bill
actually i am writing to say eexactly that.
while /dev/flash is owned by root flash,
/dev/sdb1 that it points to on reboot is root disk, not root flash as i set it.
which is kind of irritating since i basically lose the functionality.

ganshley where do you suggest i put the 'users' keyword ?
instead of 'group' in fstab? cause i thought the keyword in fstab that enabled groups checking is 'group' ...
 
Old 02-14-2007, 04:29 AM   #9
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Yes, the easy way is to use 'users' or 'user' instead of 'group' in the fstab mount options field.
If you put 'user' only the person who mounts the device will be able to unmount it. If you put 'users' then any user can unmount the devide, even if another user mounted it.
Links that you create to /dev files shouldn't affect the real device, because links are always rwxrwxrwx (777) anyway.
 
  


Reply



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 list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 01:14 PM
Mount NTFS user and group confusion. smudge|lala Linux - Hardware 10 10-21-2006 12:56 PM
User and Group Admin: How to tell Who is in What group? Akhran Linux - Newbie 1 11-12-2005 11:16 PM
And yet more random questions from a former Windows user Ebisu_Dave Linux - Newbie 8 07-16-2005 01:09 PM
Samba mount, user/group IDs fennec Linux - Networking 0 08-22-2004 02:54 PM

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

All times are GMT -5. The time now is 10:21 AM.

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