samba share multi user access

ARK

My Name is ARK. Expert in grasping any new technology, Interested in Sharing the knowledge. Learn more & Earn More

5 Responses

  1. msdudhani says:

    Hi Ravi,

    i am getting below error while configure the samba client.
    Error details:
    [root@bgclient01 sbin]# mount -a
    /sbin/mount.cifs: invalid option — ‘t’

    Usage: mount.cifs -o

    Mount the remote target, specified as a UNC name, to a local directory.

    Options:
    user=
    pass=
    dom=

    Less commonly used options:
    credentials=,guest,perm,noperm,setuids,nosetuids,rw,ro,
    sep=,iocharset=,suid,nosuid,exec,noexec,serverino,
    mapchars,nomapchars,nolock,servernetbiosname=
    directio,nounix,cifsacl,sec=,sign,fsc

    Options not needed for servers supporting CIFS Unix extensions
    (e.g. unneeded for mounts to most Samba versions):
    uid=,gid=,dir_mode=,file_mode=,sfu

    Rarely used options:
    port=,rsize=,wsize=,unc=,ip=,
    dev,nodev,nouser_xattr,netbiosname=,hard,soft,intr,
    nointr,ignorecase,noposixpaths,noacl,prefixpath=,nobrl

    Options are described in more detail in the manual page
    man 8 mount.cifs

    To display the version number of the mount helper:
    mount.cifs -V

    Configuration File Details:

    [root@bgclient01 sbin]# vi /etc/fstab

    #
    # /etc/fstab
    # Created by anaconda on Mon May 30 09:32:40 2016
    #
    # Accessible filesystems, by reference, are maintained under ‘/dev/disk’
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=93feecc8-8474-493b-a9e7-c0290421dc7d / ext3 defaults 1 1
    UUID=1fcf2890-98f5-4b69-9db1-35641bcc3826 /boot ext3 defaults 1 2
    UUID=6c5e689a-28c0-4eab-a7ec-f76e547c19f7 swap swap defaults 0 0

    //10.xx.xx.xx/multiuser /nfssamba cifs,credentials=/root/access,defaults,multiuser,sec=ntlmssp 0 0

    Please help to resolve on this.

    regards
    Mahesh Dudhani

    • Syntax what you have written in /etc/fstab file is correct but did you enabled the Firewall ports from server and SELinux context. Try to mount manually without adding an entry in /etc/fstab file use #mount //server/ShareName /mountpoint -o username=user

      while mounting you have to use share name .i.e.[mutiuser] not directory path.

  2. D says:

    fstab entry seems incorrect. There is a comma after cifs. I reckon the two options are separate, and mount options.

  3. James says:

    Hi Ark,

    Thanks for your tutorial. Very informative.

    Just one question: how to use the cifscreds command? I understand it is for the Samba multiuser environment, but I don’t know how to get it worked. My hypothetical environment is as follows:

    ==========
    Server Side (server.example.com)
    ==========
    1) Two Linux users: user1 user2. Both belong to group sambagroup.

    2) Added both users to Samba user database via ‘smbpasswd -a user1’ and ‘smbpasswd -a user2’

    3) mkdir /sambashare; chgrp sambagroup /sambashare; chmod 2770 /sambashare

    4) Edited /etc/samba/smb.conf accordingly. All services, firewall, and SELinux are configured properly. Shared folder can be accessed and mounted from remote clients.

    ==========
    Client Side
    ==========
    1) Add following to /etc/fstab:

    //server.example.com/sambashare /sharedfolder cifs _netdev,multiuser,credentials=/root/smbpass 0 0

    2) Added user1 login information into /root/smbpass:

    username=user1
    password=pass

    3) mount -a can mount remote folder.

    Now if I use ‘touch testfile’ in the folder, the file owner is always user1. I suppose this is where the cifscreds comes in, but don’t know how it worked. What should i do so that I can create a file under the owner user2?

    Thank you very much!

Leave a Reply

Your email address will not be published. Required fields are marked *