mount smb share as rw for non-root user


Results 1 to 13 of 13

Thread: mount smb share as rw for non-root user

  1. #1
    Join Date
    Sep 2003
    Location
    Knoxville, TN
    Posts
    123

    mount smb share as rw for non-root user

    Okay, at work (a windows shop) I have Fedora Core 2 setup and I've got just about everything worked out to where I don't have to boot into XP much anymore except for one thing: my personal folder with all my docs, downloads, etc... is on a shared folder of our Windows 2000 server. I can mount the folder just fine using samba but I can only mount it as root, not my normal user account. So then with the share mounted as root I cannot access my files while I'm logged in as normal user (permission denied). How can I mount the share rw to all users instead of just root? I've tried the following - "mount -t smbfs -o rw username=***,password=*** //<server share> /home/steve/h:" but that doesn't seem to work. Do I have the syntax wrong or is there an entirely different way to do this?

  2. #2
    Join Date
    Jan 2004
    Location
    boston, mass USA
    Posts
    1,878
    i would add your user to the sudo file to allow you user to mount things.

    then i would as user:

    mount -t smbfs //server/share /local/mountpoint -o username=w2kaccount/domain (if needed)

    and this will prompt for w2kaccount password and mount the mount for you.

    I dont "think" you have to indicate rw if that account has rights to write, right?
    Last edited by happybunny; 10-07-2004 at 07:14 PM.

  3. #3
    Join Date
    Sep 2004
    Location
    /home/
    Posts
    1,204
    make sure samba is configured properly. if your 2000 server is ntfs you have to change your smb.conf file for ntfs. if its fat then the previous post is correct. fc2 doesnt natively write to ntfs only read



    soule
    Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey

    IRC #linuxn00b

    Support your Distro.
    Slackware Store
    Archlinux Schwag

  4. #4
    Join Date
    Jan 2004
    Location
    boston, mass USA
    Posts
    1,878
    but if its mounted from a remote system, the actual filesystem doesn't matter.

  5. #5
    Join Date
    Mar 2002
    Location
    Pennsylvania, USA
    Posts
    1,713
    Take a look at this article in the JL library:

    http://www.justlinux.com/nhf/Filesys...rmanently.html

    The solution to your problem is down near the bottom.
    If God hadn't meant for us to use GUI tools, there wouldn't have been a Xerox PARC.

  6. #6
    Join Date
    Sep 2004
    Location
    /home/
    Posts
    1,204
    okay here is my ?. ive got a a 250 gig drive that is ntfs. i can read the drive (following the same instructions as above) but i cannot write to it. samba doesnt allow writing to ntfs shares( it does to fat,fat32) but not to samba, i had to add a line in smb.conf to make my FC2 box write across the samba share to the ntfs drive. if what you are saying is true, i didnt need to do that. if i understand this correctly what could i have done differently



    soule
    Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey

    IRC #linuxn00b

    Support your Distro.
    Slackware Store
    Archlinux Schwag

  7. #7
    Join Date
    Jan 2004
    Location
    boston, mass USA
    Posts
    1,878
    my understanding and experiance is that is does not matter one bit what type of partition formating was used on the remote file system, be it NTFS, FAT, OSX, UNIX, what have you.

    This is what I do:

    local os=linux
    remote os=W2K (or any OS, really. W2K uses smb connections. It could be nfs or anything)

    on linux as any user:

    mkdir mp3s
    mount -t smbfs //server/share mp3s -o username=userwithrightpermission
    Password: (then i enter password when prompted so noone can see my password)

    this mounts teh remote W2K NTFS filesystem to my folder mp3s which i own since i created it.
    If the user I used to mount it has permissions on the W2K Server to write to this share, I too can write to it since my connection uses the username=userwithrightpremisions account.

    My local OS (linux) doesn't know about or care what filesystem the foreign harddrive was formated with.

    Note: if using a domain account, the syntax is username=username/domain

    Hope this helps.

    Oh, one more thing. Since normal users cant mount things, you could put your local user account in the sudo file so that that user has permissions to mount things. Also, you could put this into /etc/fstab with user mountable permissions, too. Maybe this is what you really need help with.

    Also, this has nothing to do with your linux samba configuration as a previous posted suggested. The local linux samba is only if you need to share your linux filesystem with MS OS's.
    Last edited by happybunny; 10-10-2004 at 03:31 PM.

  8. #8
    Join Date
    Sep 2004
    Location
    /home/
    Posts
    1,204
    happybunny

    okay im kinda of taking over this run, but this is bugging the crap out me. i create a dir. lets say

    /mnt/share

    i give it all perm. 777

    i mount the 250 gig drive. with user write perm in windows.

    mount -t smbfs //server/share /mnt/share

    enter username and pass.

    the dir /mnt/share then has perm for drwxr_xr_x

    i just figured out my problem i CAN write to the drive as root, not as user. is there a way to mount it so users can write to it, without sudu?


    ps thanks for helping me help myself


    soule
    Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey

    IRC #linuxn00b

    Support your Distro.
    Slackware Store
    Archlinux Schwag

  9. #9
    Join Date
    Jan 2004
    Location
    boston, mass USA
    Posts
    1,878
    whats the issue with using sudo? You can just let that user have access to the mount command and nothing else.

    I ask, 'cause I can't get it to work otherwise....BUT:

    this is what i have done,

    I have added:

    //server/share /mnt/share smbfs user,owner,rw 0 0

    to my fstab.

    Now, anyone who does 'mount /mnt/share' will be prompted for password to my share. I think I can add an actual user to the fstab line to mount it everytime as a certain user.

    However, I am back to the "only root can mount" problem telling me:

    smbmnt must be installed suid root for direct user mounts (1000,1000)

    but i have no idea what that means yet.....YET!

    Ill keep working it but, again, is there a reason against sudo?

  10. #10
    Join Date
    Sep 2004
    Location
    /home/
    Posts
    1,204
    the only prob with sudu is if im cutting and pasting with konqourer or something


    soule
    Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey

    IRC #linuxn00b

    Support your Distro.
    Slackware Store
    Archlinux Schwag

  11. #11
    Join Date
    Jan 2004
    Location
    boston, mass USA
    Posts
    1,878
    you would only use sudo to allow your normal user access to the mount command, so that that normal user will have permissions to mount the remote filesystem to a local folder. Once the initial sudo mount command is done, you can point and click away at will.

    visu command will open the sudousers file, then add:

    usersname ALL=/sbin/mount /localshare NOPASSWD: ALL

    Then, as that user:

    sudo mount /localshare -o username=remoteshareusername/domain

    This will grant usersname access to the mount command only for the /localshare folder, and not prompt that user for his sudo password (which is his local machine password), but WILL prompt for the password for the remote user.

    Once mounted, you can do what ever you like....it acts like a local file system.

  12. #12
    Join Date
    Mar 2002
    Location
    Pennsylvania, USA
    Posts
    1,713
    To give users other than root r/w access to the share, you need to use the uid and or gid parameters with the smbmount command. See the link I provided above or the man page for smbmount.
    If God hadn't meant for us to use GUI tools, there wouldn't have been a Xerox PARC.

  13. #13
    Join Date
    Mar 2003
    Location
    hiroshima
    Posts
    15
    I have a similar problem, needing to mount a remote w2k share on a linux terminal server. I tried the gid option mentioned in cowanrl's link, but it still doesn't work.
    I need my terminal users to all have access to the share, so I put them all in a group and put its gid in fstab, like the article says. It seems that whatever I do the share mounts as 755 and no-one can write to it. The mount point itself is 777 before mounting, and i also chmoded it to root:newgroup.

    I want the users to click on the share link on the gnome desktop and use it like they do in windows. I don't want them having to open terminals and typing sudo commands.

    this thing is supposed to possible - what are we overlooking?
    nigel
    hiroshima
    linux counter #208272

Posting Permissions

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