Back

How Do I Map a Network Share On Linux?


Given an SMB file share available on your network as \\sharename\budget\ that you wish to have mapped to the Confluence server as /mnt/share/budget, perform the following steps:

  1. Make sure the necessary dependencies are installed for mounting an SMB share; for Debian based systems please run sudo apt-get install cifs-util

  2. Ensure you have a mount point for the network share e.g., /mnt/share/budget by creating a new folder using sudo mkdir -p /mnt/share/budget.

  3. Prepare a credentials file by creating a file located at /root/.smbcredentials which contains the following:

    username=myusername
    password=mypassword

    where myusername and mypassword are changed to a username and password accepted by the network share server.

  4. Create a new entry in the file /etc/fstab with the following information:

    //sharename/budget /mnt/share/budget cifs credentials=/root/.smbcredentials,sec=ntlm,iocharset=utf8 0 0

The argument credentials=/root/.smbcredentials should point to the credentials file mentioned above.

  1. Run the following command sudo mount -a or restart the Linux server to mount the configured network share

  2. The mapped network share should now be available at /mnt/share/budget

Back