[linux-cifs-client] Hello

Jeff Layton jlayton at redhat.com
Tue Oct 27 04:45:22 MDT 2009


On Mon, 26 Oct 2009 14:06:13 -0400
Linux User <linuxuser09 at gmx.com> wrote:

> I'm not sure if I am on the right mailing list for this questions. I'm having 
> a hard time understanding/setting file permissions/uid/gid on the client side.
> 
> Here's my mount line:
> 
> sudo mount.cifs //comp2.localnet.webwaredev.org/games /mnt/games-share -v -o 
> uid=500 gid=networkshares file_mode=0775 dir_mode=0775
> 
> It's in verbose and this was what was outputted:
> 
> mount.cifs kernel mount options: 
> unc=//comp2.localnet.webwaredev.org\games,user=root,ver=1,uid=500,ip=192.168.0.3,pass=********
> 
> And this is what I am running into:
> 
> [lhorace at netsrv games-share]$ cd test
> [lhorace at netsrv test]$ mkdir test2
> [lhorace at netsrv test]$ ls -l
> total 0
> drwxr-xr-x. 2 lhorace root 0 2009-10-26 12:28 test2
> [lhorace at netsrv test]$ touch filetext.txt
> touch: cannot touch `filetext.txt': Permission denied
> [lhorace at netsrv test]$ cd test2
> [lhorace at netsrv test2]$ touch filetest.txt
> touch: cannot touch `filetest.txt': Permission denied
> [lhorace at netsrv test2]$
> 
> On a regular filesystem folder, if I am the owner of the folder, I should be 
> able to create files within the folder. And reading the output correctly, it 
> seems that uid is the only thing that get's pass to the kernel.
> 
> Note: uid=500 = lhorace, and lhorace exists on bothsystems including 
> networkshares.
> 
> What am I doing wrong? Any hints/clues would be entirely appreciative thank 
> you.. =)

Permissions on CIFS are confusing stuff...

CIFS doesn't manage multiple credentials per mount. In this case,
you're mounting the share with "user=root". So even though on the local
machine you're "lhorace" and the dir is owned by "lhorace" on the
server, the call goes out over the wire as "root" (which is probably
being mapped to an unprivileged user).

You probably want to redo the mount with user=lhorace, but be
forewarned that all the activity will be done as "lhorace" no matter
what user on the client is doing this activity.

-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list