linux_wiki:cifs_windows_shares

This is an old revision of the document!


CIFS Windows Shares

General Information

Creating Samba server file shares (CIFS) and mounting CIFS shares on Linux.

Checklist

  • Enterprise Linux 6/7

CIFS Server Setup

TODO


CIFS Client Setup

  1. Install Packages
    yum install -y cifs-utils samba-client
  2. List remote shares
    smbclient -L <remote-cifs-server>
  3. Create local directory structure to mount the shares in
    mkdir -p /data/shared/<win-share-name>
  4. Create root ssh directory if it does not exist
    mkdir /root/.ssh
    chmod 700 /root/.ssh
  5. Create the CIFS credentials file
    touch /root/.ssh/.<win-share-name>
    chmod 600 /root/.ssh/.<win-share-name>
  6. Edit the credentials file, add share's user/pass/domain
    vim /root/.ssh/.<win-share-name>
    
    username=<user>
    password=<password_here>
    domain=<domain>
  7. Create persistent CIFS mount in /etc/fstab
    vim /etc/fstab
    //<remote-cifs-server>/<sharename> /data/shared/<win-share-name>  cifs  auto,credentials=/root/.ssh/.<win-share-name>,_netdev,uid=<user>,gid=<users>,rw  0 0
  8. Mount the share
    mount -a

  • linux_wiki/cifs_windows_shares.1451967748.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)