Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting permissions on a device?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Boorish Id
n00b
n00b


Joined: 26 Nov 2004
Posts: 71

PostPosted: Tue Feb 22, 2005 10:03 am    Post subject: Setting permissions on a device? Reply with quote

Ok this goes back to my question about the zip drive but now i know more about what im trying to say, so maybe it will make more sense to you guys. Ok i installed a zip drive, the drives filesystem is linked to /dev/hdc1. i have a directory called /mnt/zip and its permissions are rwxrwxrwx root being the owner and group. So i log in on my normal user account i can access /mnt/zip just fine no problems at all. then on tty2 i log in as root execute the command mount /dev/hdc1 /mnt/zip, loged in as root i can do whatever i want to /mnt/zip. Then i go back to tty1 wich is loged in under my user account i try to access /mnt/zip and get permission denied! So i can only access /mnt/zip when with a normal account when the zip drive is not mounted basically. Ok so some tutorias on line said to set the permission of /dev/hdc1 to a+rw, everytime i do this the permissions on /dev/hdc1 do not change, becuase its a symbolic link im guessing? So why the hell do these how to's tell you to change the permissions on the link. My question is how do you let normal users read the drive and write to it with out using -o umask=000 in the mount command, although this would work i dont necisarly want everyone on the system to acually be able to do whatever they want to the drive.
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Feb 22, 2005 1:16 pm    Post subject: Reply with quote

Please buy a keyboard with an Enter key.

man mount wrote:
(iii) Normally, only the superuser can mount file systems. However,
when fstab contains the user option on a line, anybody can mount the
corresponding system.

Thus, given a line
/dev/cdrom /cd iso9660 ro,user,noauto,unhide
any user can mount the iso9660 file system found on his CDROM using the
command
mount /dev/cdrom
or
mount /cd
For more details, see fstab(5). Only the user that mounted a filesys-
tem can unmount it again. If any user should be able to unmount, then
use users instead of user in the fstab line. The owner option is simi-
lar to the user option, with the restriction that the user must be the
owner of the special file. This may be useful e.g. for /dev/fd if a
login script makes the console user owner of this device. The group
option is similar, with the restriction that the user must be member of
the group of the special file.


Sounds like this is what you are looking for, right? :)

HTH
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
Boorish Id
n00b
n00b


Joined: 26 Nov 2004
Posts: 71

PostPosted: Tue Feb 22, 2005 8:19 pm    Post subject: Reply with quote

no, i want root to be able to mount a file system only, but i want other groups (not everyone) to be able to access it after root has mounted it.
Back to top
View user's profile Send private message
Boorish Id
n00b
n00b


Joined: 26 Nov 2004
Posts: 71

PostPosted: Tue Feb 22, 2005 9:07 pm    Post subject: Reply with quote

this doesnt seem uncommon, the reason i need to do it is becuase i want a group of people who have shell accounts and when they log in they dont need access to my drives but i want everyone that acually has a system account to be able to access it, and i want access to it if i log in on my account via ssh
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Feb 22, 2005 9:57 pm    Post subject: Reply with quote

Boorish Id wrote:
this doesnt seem uncommon, the reason i need to do it is becuase i want a group of people who have shell accounts and when they log in they dont need access to my drives but i want everyone that acually has a system account to be able to access it, and i want access to it if i log in on my account via ssh

I see.

I think the "group" option should do that (see man mount on it).
Put the users who should be able to mount it in the "cdrom" group, and a line in fstab like:
/dev/cdrom /mnt/cdrom auto noauto,ro,group,nosuid,noexec 0 0

Then, as a user, mount /mnt/cdrom.

Can't test it myself right now but it should work.
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
Boorish Id
n00b
n00b


Joined: 26 Nov 2004
Posts: 71

PostPosted: Thu Feb 24, 2005 11:36 pm    Post subject: Reply with quote

Thank you for the info i did exactly what you told me too, and it didnt work :(, i also looked through the man mount info and there was no option for group there is there is an option called user wich will let an ordinary user mount the FS but i dont quite understand how it knows the user name. When i followed your advice i tried to mount it and it said only root can do this then i mounted as root and it still would not let me look at the dir under my user account
Back to top
View user's profile Send private message
Boorish Id
n00b
n00b


Joined: 26 Nov 2004
Posts: 71

PostPosted: Thu Feb 24, 2005 11:50 pm    Post subject: Reply with quote

whats really odd is when the the fs is mountes it says everyone has at least read access to /mnt/zip and when i try to cd to it i get permission denied!
Back to top
View user's profile Send private message
GungHo
Apprentice
Apprentice


Joined: 27 Aug 2004
Posts: 254

PostPosted: Fri Feb 25, 2005 2:43 pm    Post subject: Reply with quote

Hi,

for cd'ing to somewhere you need execute permission on this directory, read permission is not enuf
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum