[vox-tech] CIFS sharing question

Bill Kendrick nbs at sonic.net
Thu Jan 22 00:18:10 PST 2009


Ok, so I finally had some time to sit down this evening and try to
configure my NAS.

I've got a 'MUSIC' share which can be accessed by two users that I created
on the NAS using its web admin interface.

'guest' has read-only access.  'kendrick has read-write.


The way I've gone about it so far isn't working so well.
I created a user on my laptop, 'music'.
I created a '/shares/music' folder on my laptop, and
a credentials file with the password for the 'kendrick' user
I created on the NAS, and added the following to my laptop's
/etc/fstab:

//ns2300n/MUSIC /shares/music cifs auto,uid=music,gid=music,credentials=/etc/nas-credentials,file_mode=0777,dir_mode=0777,iocharset=utf8,rw 0 0

If I don't supply the "uid=", I'll end up with all of the
files appearing to be owned by the 2nd user I added to my
laptop (since I added the 'kendrick' user 2nd on the NAS).
I guess they're both uid 1001. :)

I can mount this with "sudo mount /shares/music".
I can even go in and create files and folders.
HOWEVER, I don't own them, and because the 'umask' of
the user on my laptop is set conservatively (0077),
I cannot actually access these files.

They appear on my laptop as owned by music:music
and rw[x]-----.

If I manually changed my umask first ('umask 0007'),
that helps.  Things come out rw[x]rw[x]---.
But since I guess I'm not in the 'music' group on
my laptop by default, I need to do a 'newgrp music'
before I can read/write the files.

So what do I want, precisely?

(1) User on the NAS named 'kendrick' who has R/W access
    to the MUSIC share.

(2) Ability to mount that share on my laptop, and
    actually read/write files without issuing any
    housekeeping commands (umask, newgrp, sacrifice --type=goat)
    beforehand.

(3) In fact, I only want the NAS mounts to appear if I'm
    on my home network (so that things don't timeout and
    fail when I boot up at Common Grounds, Mishka's,
    Crepeville, etc.)  Alternatively, the ability to
    mount as my local desktop user.

    NOTE: Every time I tried adding "user" to the fstab
    options, mount.cifs would warn that it's ignoring
    a blank username.  Damnit, I'm not saying "user"
    as in "user=USERNAME", I'm saying "user" as in
    "anybody can mount the corresponding system."
    Though I guess in that case, I really want to
    mount using the guest/guest read-only credentials.
    Woe is me.  What the heck do I want here, anyway?

Thanks in advance for any tips.

-- 
-bill!
"Tux Paint" - free children's drawing software for Windows / Mac OS X / Linux!
Download it today!  http://www.tuxpaint.org/


More information about the vox-tech mailing list