Jump to content
Sign in to follow this  

Mount Windows share Centos 8

Recommended Posts

Installing CIFS Utilities Packages

To mount a Windows share on a Linux system, first you need to install the CIFS utilities package.

  • Installing CIFS utilities on CentOS and Fedora:
sudo dnf install cifs-utils


Auto Mounting

sudo nano /etc/fstab
  • Add the following line to the file:
# <file system>             <dir>          <type> <options>                                                   <dump>  <pass>
//WIN_SHARE_IP/share_name  /mnt/win_share  cifs  credentials=/etc/win-credentials,file_mode=0755,dir_mode=0755 0       0

Run the following command to mount the share:

mount -a

Creating Credential File

For better security it is recommended to use a credentials file, which contains the share username, password and domain.


The credentials file has the following format:

username = user
password = password
domain = domain

The file must not be readable by users. To set the correct permissions and ownership run:

sudo chown root: /etc/win-credentials
sudo chmod 600 /etc/win-credentials








Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Create New...