CIFS/SMB
- Written on: 2024-02-15
- Debian version used: 12
Mounting a CIFS/SMB share
first we need to install the cifs-utils
package
sudo apt install cifs-utils
next, make the directory where we will mount the share to, for example /mnt/nas/share
sudo mkdir -p /mnt/nas/share
Next, make a file to store our credentials
sudo nano /etc/cifs-credentials
with the following content
username=[username] password=[password]
next change it's permissions so it's secure
sudo chmod 600 /etc/cifs-credentials
Now edit sudo nano /etc/fstab
and add a line like this:
edit uid/gid to the user/group you want to mount to in linux.
//[IP_address]/[share_name] /mnt/nas/share cifs credentials=/etc/cifs-credentials,uid=vincent,gid=vincent 0 0