LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   file access in slackware 10.0 (https://www.linuxquestions.org/questions/linux-newbie-8/file-access-in-slackware-10-0-a-269063/)

bmarx 12-22-2004 01:12 AM

file access in slackware 10.0
 
I am having trouble accessing my other ntfs partitions from slackware 10.0 when i am not logged in as root. I can mount and unmount fine as root and view the contents of the folder, but not as another user. Things i have tried:

1. Modify fstab so that the options of the partition i want to be able to mount has:

ro,user

Have also tried "noauto" to see if i could mount after boot, no luck.

2. As root, do a chmod command like so:

chmod +r /hdb5



I am new, but from what i had read, the line in the fstab file would be enough to allow a user to mount and unmount a logical drive. Please point out what i am doing wrong, or point out where in the documentation i fouled up. Thanks.

whipermr5 12-22-2004 01:20 AM

"chmod +r /hdb5" is not enough. It only lets other users read the dir, not write it. Try reading the chmod man page.

bmarx 12-22-2004 02:13 AM

But i do not want to be able to write to the drive. I have read that writing to ntfs is at best experimental.

The problem is that i can not even view the files, or mount the drive when i am not logged in as root.

DaHammer 12-22-2004 02:26 AM

Post your fstab

DaHammer 12-22-2004 03:01 AM

Well gotta run, so figured I'd post this for you before I went. If you want the partition mounted at startup and any user to be able to access the files, then use something like this:
Code:

/dev/hdb5    /mountpoint    ntfs    umask=000,auto,nouser,async,ro    1  0
That will automount the parition at /mountpoint (change to where ever you want it mounted). The umask=000 is what allows other users besides root to access the files.


If you'd rather it not be mounted automatically and instead want users to be able to mount it themselves, then use something like this:
Code:

/dev/hdb5    /mountpoint    ntfs    noauto,user,ro    1  0
Now any user can mount it and they will own all the files it contains, as far as linux is concerned.


Keep in mind that if it's already mounted then you'll need to unmount it as root before a user can remount it. See "man mount" for help on what each of the mount options do and "man fstab" for help on what each field is for. You may want to change it a bit, depending on what you want. Like if you want to be able to execute files on the parition then add the "exec" option and etc.


Edit:
BTW, when using mount as a user, specify either the mount point or device ONLY, not both. ie "mount /dev/hdb5" or "mount /mountpoint", but not "mount /dev/hdb5 /mountpoint". The first 2 causes mount to reference /etc/fstab for the options, the 3rd only root can do.

whipermr5 12-22-2004 06:14 AM

Quote:

But i do not want to be able to write to the drive. I have read that writing to ntfs is at best experimental.

The problem is that i can not even view the files, or mount the drive when i am not logged in as root.


In order to mount the drive, you must enable write support. If you specified in the kernel, you will still not be able to write to that drive, even though the permissions are OK.

bmarx 12-22-2004 11:25 PM

well, i am able to mount and umount the drive as an ordinary user, but when i try to cd to it, it says permission denied.


fstab:
/dev/hdb2 swap swap defaults 0 0
/dev/hdb1 / ext2 defaults 1 1
/dev/hdb5 /hdb5 ntfs ro,user 1 0



/hdb5 is the troublesome one


i have not tried putting in defaults for the ntfs partition, and would like to avoid that if at all possible.

whipermr5 12-22-2004 11:37 PM

I have exactly the same problem too.

bmarx 12-23-2004 01:17 AM

ok, i was able to mount and view the files as a non-root user using the "umask=000" option in fstab. From what i understand though, this option allows any user to mount, unmount, read, write, execute files in the directory- not good.

Is there any other way to be able to mount and view/execute files as a non-root user- more specifically, is there a way to pick and choose among different users who can view and execute files? which was part of my original problem.


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