CentOS 7.x mount samba share

From Notes_Wiki
Revision as of 09:34, 6 June 2019 by Saurabh (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

<yambe:breadcrumb self="Mount samba share">CentOS_7.x_Samba|Samba</yambe:breadcrumb>

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:


<yambe:breadcrumb self="Mount samba share">CentOS_7.x_Samba|Samba</yambe:breadcrumb>