SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
This line in your /etc/fstab will do the trick (in this case: mount a floppy):
Code:
/dev/fd0 /mnt/floppy auto noauto,rw,user 0 0
Don't know what you do/don't know about this, so here's a small explenation (from left to right):
/dev/fd0 => points to your floppy device
/mnt/floppy => the mountpoint for the floppy (should exist)
auto => guess the filesystem (could be a unix or dos floppy, to name just 2)
noauto => do not mount during boot
rw => mount floppy read/write
user => anybody can mount this device (this is the one you are asking for)
0 0 => have to do with dump/fsck, 0 means no check.
Take a look at man mount for more options and details.
Hope this helps.
Quote:
P.S.sorry if my question is too silly....
The only silly question is the one that is not asked.
This line in your /etc/fstab will do the trick (in this case: mount a floppy):
Code:
/dev/fd0 /mnt/floppy auto noauto,rw,user 0 0
Don't know what you do/don't know about this, so here's a small explenation (from left to right):
/dev/fd0 => points to your floppy device
/mnt/floppy => the mountpoint for the floppy (should exist)
auto => guess the filesystem (could be a unix or dos floppy, to name just 2)
noauto => do not mount during boot
rw => mount floppy read/write
user => anybody can mount this device (this is the one you are asking for)
0 0 => have to do with dump/fsck, 0 means no check.
Take a look at man mount for more options and details.
Hope this helps.
The only silly question is the one that is not asked.
Hi Druna thanks so much for your attention
this is the line in my fstab fle:
/dev/fd0 /mnt/floppy auto noauto,rw,user 0 0
i tried to mount floppy like normal user
using the command:
I do recall that certain distro's remove the sticky bits of the mount program (makes it safer, but less flexible).
mount should reside in /bin. Do a ls -l /bin/mount, the output should look like this:
$ ls -l /bin/mount -rwsr-xr-x 1 root root 64764 May 30 2004 /bin/mount
The bold part is what you need to look at, if it doesn't look like above but something like this: -rwx------ (no s anywhere), the permissions have been changed.
To return to the original setting do (as root):
chmod 4755 /bin/mount
If the permissions of the mount command are not the problem........
Well, only other thing I can come up with is the following: Is the user trying to mount the floppy member of the /dev/fd0 group? Type id when logged in as that user (or an id <user> as root). The 'floppy' group should be present in the groups=......... list.
If not, make that user a member of that group:
usermod -G <floppygroup> <user>
WARNING
If there are any groups mentioned in the groups= list, these need to be added again (minus the primary group), otherwise they are gone!!! WARNING
Example:
$ id megalodon
uid=502(megalodon) gid=501(users) groups=501(users),400(visitor)
$ usermod -G floppy,visitor megalodon
$ id megalodon
uid=502(megalodon) gid=501(users) groups=501(users),78(floppy),400(visitor)
In the above example users is the default group, visitor is already present. To add floppy you need to include visitor in the usermod line.
Just for completeness I'd like to add a couple of things:
1. in fstab you can have "user" or "users" as a part of your mount line. The difference is "user" will only let the user who mounted the resource unmount it, while "users" will let any user unmount the resource, even if they didn't mount it. Useful to know if you're using it in a multiuser environment.
2. to use mount as a user from fstab you should only pass one argument to mount: the device or the mount point.
Code:
~$ mount /mnt/floppy
~$ mount /dev/fd0
Mount will intelligently look through fstab to see what it can find and match a rule based on what's in fstab. It stops you dynamically moving mountpoints, which surely is a security issue. Being in a single-user environment I don't really see anything malicious, but, there we go =)
I do recall that certain distro's remove the sticky bits of the mount program (makes it safer, but less flexible).
mount should reside in /bin. Do a ls -l /bin/mount, the output should look like this:
$ ls -l /bin/mount -rwsr-xr-x 1 root root 64764 May 30 2004 /bin/mount
The bold part is what you need to look at, if it doesn't look like above but something like this: -rwx------ (no s anywhere), the permissions have been changed.
To return to the original setting do (as root):
chmod 4755 /bin/mount
If the permissions of the mount command are not the problem........
Well, only other thing I can come up with is the following: Is the user trying to mount the floppy member of the /dev/fd0 group? Type id when logged in as that user (or an id <user> as root). The 'floppy' group should be present in the groups=......... list.
If not, make that user a member of that group:
usermod -G <floppygroup> <user>
WARNING
If there are any groups mentioned in the groups= list, these need to be added again (minus the primary group), otherwise they are gone!!! WARNING
Example:
$ id megalodon
uid=502(megalodon) gid=501(users) groups=501(users),400(visitor)
$ usermod -G floppy,visitor megalodon
$ id megalodon
uid=502(megalodon) gid=501(users) groups=501(users),78(floppy),400(visitor)
In the above example users is the default group, visitor is already present. To add floppy you need to include visitor in the usermod line.
If anything is unclear, just ask.
Hope this helps.
Hi again...well the permissions of the mount command are not the problem i think becouse the output is this:
-rwsr-xr-x 1 root bin 68804 2004-5-27 23:26 /bin/mount
after that i logged like user(carmelo) and i typed :
id carmelo ...this is the output:
uid:1000(carmelo) gid=100(users)groups=100(users),11(floppy)
When you use something like mount /dev/fd0 or mount /mnt/floppy, mount will look in the /etc/fstab file to find the 'missing' information. When you use mount /dev/fd0 /mnt/floppy mount will not use the fstab file. To my knowledge the /etc/fstab file is the only place you can tell (using user/users) thet normal users can mount something.
Thus, trying to mount directly as normal user will cause an error message.
Only normal way to make sure that one (or a select group) user can use mount is to remove mounts sticky bit and use sudo.
When you use something like mount /dev/fd0 or mount /mnt/floppy, mount will look in the /etc/fstab file to find the 'missing' information. When you use mount /dev/fd0 /mnt/floppy mount will not use the fstab file. To my knowledge the /etc/fstab file is the only place you can tell (using user/users) thet normal users can mount something.
Thus, trying to mount directly as normal user will cause an error message.
Only normal way to make sure that one (or a select group) user can use mount is to remove mounts sticky bit and use sudo.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.