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:
-
Make sure the necessary dependencies are installed for mounting an SMB share; for Debian based systems please run
sudo apt-get install cifs-util
-
Ensure you have a mount point for the network share e.g.,
/mnt/share/budget
by creating a new folder usingsudo mkdir -p /mnt/share/budget
. -
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. -
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.
-
Run the following command
sudo mount -a
or restart the Linux server to mount the configured network share -
The mapped network share should now be available at
/mnt/share/budget