From Notes Wiki
Revision as of 09:34, 6 June 2019 by Saurabh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home > CentOS > CentOS 7.x > file sharing > Samba > Mount samba share

CentOS 7.x mount samba share

To mount samba (CIFS or Windows file sharing) file share in Linux use

  1. yum -y install cifs-utils
  2. Create desired mountpoint such as:
    mkdir /mnt/fileserver
  3. List mountpoints using:
    smbclient -L <IP> -U username
    and enter password for listing mount points
  4. To access files without mouting use:
    smbclient //<ip>/share -U username
    and enter password to get smb client based file access.
  5. Mounting using command similar to:
    mount -t cifs --verbose '//<IP>/<share-name>' /mnt/fileserver -o 'username=administrator,password=secret'
  6. In case of older Windows Server 2003 above command fails with output:
    mount.cifs kernel mount options: ip=<ip>,unc=\\<server>\<share-name>,user=administrator,pass=********
    mount error(95): Operation not supported
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    with /var/log/messages having suggestion:
    Apr 8 22:05:04 localhost kernel: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
    Apr 8 22:05:04 localhost kernel: CIFS VFS: Dialect not supported by server. Consider specifying vers=1.0 or vers=2.0 on mount for accessing older servers
    Apr 8 22:05:04 localhost kernel: CIFS VFS: cifs_mount failed w/return code = -95
  7. After this mounting worked using:
    mount -t cifs --verbose '//<IP>/<share-name>' /mnt/fileserver -o 'username=administrator,password=secret,vers=1.0'


Refer:


Home > CentOS > CentOS 7.x > file sharing > Samba > Mount samba share