Jump to content

Local permissions for remote samba shares issue


jamespetts
 Share

Recommended Posts

I am having problems with giving a non-root user permission to write files in remote Samba shares. I have a directory called /mnt/Documents (which connects to a drive on a Windows 2000 system), and whilst the root user can read and write to it, the permissions are not set for the standard user (james) to do the same. So, I try chmod a+w /mnt/Documents and it made no difference. I tried chmod o+w /mnt/Documents, and still no effect. I tried chown james /mnt/Documents, but it said, "Operation not permitted". I tried to do it from the Konquorer GUI client, but it froze and had to be killed. Am I missing something here? All that I want to be able to do is use /mnt/Documents (and all subfolders) as the place where I store all my user files on both the Windows 2000 and Linux machine. What do I have to do to accomplish that? (I am using Mandrake 8.2).

 

Thank you in advance.

 

James E. Petts

Link to comment
Share on other sites

I don't remember how to do it with samba (i switched to ftp a while back) but I am pretty sure that instead of chmod'ing you need to chown it. Read the chown man file. pretty simple stuff. On my ftp server (and my old samba) I had a bunch of dirs people had access to but couldn't upload to, and one upload directory. Not to hard to do.

Link to comment
Share on other sites

Note that most windows-type filesystems don't support the setting of individual permissions on files.

 

So, you must apply the permissions at mount time, which will apply to all files accessed by the mount point. It gets a bit sticky with permissions on the files on the server side (with NT/Win2k running on NTFS on the server).

 

To change the permissions, unmount the share, and use 'uid=','gid=', and 'umask=' options.

 

For my fat32 data share, I normally use 'uid=501,gid=502,umask=027', which gives me (I have uid 501) ownership and all permissions, the group with gid 502 has everything by write (the 2), and no one else has any permissions on the files.

 

(The umask defines which permission bits may not be set, so setting 2 prevents w access, setting 4 prevents r access, and setting x prevents execute, or for directories, enter. Then, just add them up, to get 7, for example).

 

Then, remount the share.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...