Allowing normal user to mount drives? - Page 2


Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23

Thread: Allowing normal user to mount drives?

  1. #16
    Join Date
    Aug 2002
    Location
    Essex, UK
    Posts
    937
    Yay, wet trout - but another problem...

    I can mount and unmount the drive fine as the knoppix user, but when I try to access it I get permission denied errors.

    /etc/fstab:
    Code:
    /proc      /proc       proc   defaults            0 0
    /sys       /sys        sysfs  noauto              0 0
    /dev/pts   /dev/pts    devpts mode=0622           0 0
    /dev/fd0   /mnt/auto/floppy auto   user,noauto,exec,umask=000    0 0
    /dev/cdrom /mnt/auto/cdrom  auto   user,noauto,exec,ro 0 0
    /dev/cdrom1 /mnt/auto/cdrom1  auto   users,noauto,exec,ro 0 0
    # Added by KNOPPIX
    /dev/hda1 /mnt/hda1 auto noauto,users,exec 0 0
    # Added by KNOPPIX
    /dev/hda5 /mnt/hda5 ext2 noauto,users,exec 0 0
    # Added by KNOPPIX
    /dev/hda6 /mnt/hda6 auto noauto,users,exec 0 0
    And my /etc/mtab:
    Code:
    /dev/root / ext2 rw 0 0
    /dev/hda5 /cdrom ext2 ro 0 0
    /dev/cloop /KNOPPIX iso9660 ro 0 0
    /ramdisk /ramdisk tmpfs rw,size=405616k 0 0
    /proc/bus/usb /proc/bus/usb usbdevfs rw,devmode=0666 0 0
    automount(pid468) /mnt/auto autofs rw,fd=4,pgrp=468,minproto=2,maxproto=4 0 0
    /dev/hda1 /mnt/hda1 ntfs rw,nosuid,nodev 0 0
    Registered Linux User #325947

    Check out Feather Linux, my distro.
    (Yes, it's shameless self promotion, deal with it )

  2. #17
    Join Date
    Aug 2002
    Location
    Delaware
    Posts
    4,285
    try users instead of user. and for now, try taking out the other options in the line.
    irc.freenode.net #justlinux The Not So Official JL IRC Channel.
    ¤ Debian ¤ Apt-Get ¤

  3. #18
    Join Date
    Aug 2002
    Location
    Essex, UK
    Posts
    937
    I don't think it's that, as the exact same fstab options are used in Knoppix 3.4, and that seems to work fine. Is there something like an environment variable or some permission on a file (not mount or umount, checked them) that might affect it?
    Registered Linux User #325947

    Check out Feather Linux, my distro.
    (Yes, it's shameless self promotion, deal with it )

  4. #19
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Originally posted by sharth
    try users instead of user. and for now, try taking out the other options in the line.
    The only difference between user and users is that when you use users, any user can unmount a filesystem that any other user mounted. With user, only the user that mounted it can unmount it.

    That clearly has nothing to do with this problem.

    However, it appears that Knoppix makes /etc/mtab a symlink to /proc/mounts. I believe that in that case, users is exactly equivalent to user (because according to the mount manpage, using the user option makes mount try to write the username that did the mounting to /etc/mtab).

    Originally posted by o0zi
    but when I try to access it I get permission denied errors.
    What exactly are you trying to do that's giving you permission denied errors? Read files? Write files? Execute files? cd into a directory? List the contents of a directory? Add or delete files (write to the directory)? Create or use a device node? Create or use a filesystem socket or named pipe? Execute a program with the set-uid or set-gid bit set?

    Since /dev/hda1 is NTFS, you shouldn't be able to write to it at all (writing still doesn't work unless you don't change the size of the file, and even then you have to specifically enable an option in your kernel config that's marked EXPERIMENTAL).

  5. #20
    Join Date
    Aug 2002
    Location
    Essex, UK
    Posts
    937
    I'm just trying to merely access the root directory of the drive - i.e. cd /mnt/hda1.
    Registered Linux User #325947

    Check out Feather Linux, my distro.
    (Yes, it's shameless self promotion, deal with it )

  6. #21
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    The root directory is missing execute permission:

    Code:
    $ mkdir test
    $ ls -F
    test/
    $ cd test
    $ ls
    $ cd ..
    $ chmod u-x test
    $ cd test
    test: Permission denied
    $ rmdir test
    $
    If that's not exactly the error that you're getting, then post exactly what you are getting.

    Actually, I bet it's because you don't have umask=000 (or similar) in your fstab line for hda1. This means that the Linux ntfs driver just applies some default permission scheme to everything on the partition -- likely 0444 or 0644 (the owner and group will be UID and GID 0, which are usually root and root).

  7. #22
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    2,170
    I think I saw that to let normal users do mounting you must edit the /etc/sudoers file so that the restrictions can be relaxed a little.
    Come under the reign of the Idiot King...
    Come to me ... I love linux!

    Registered Linux user: Idiot King #350544

  8. #23
    Join Date
    Aug 2002
    Location
    Delaware
    Posts
    4,285
    Originally posted by bwkaz
    The only difference between user and users is that when you use users, any user can unmount a filesystem that any other user mounted. With user, only the user that mounted it can unmount it.
    Yeah. but you know that this would come up later.
    irc.freenode.net #justlinux The Not So Official JL IRC Channel.
    ¤ Debian ¤ Apt-Get ¤

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •