How to mount a Samba share in Ubuntu (2024)

  Uncategorized
# **************************
#
# set up a samba share
#
# # **************************
sudo apt install -y cifs-utils

sudo nano /etc/nas1.credentials
username=abc
password=abc

# create dirs
sudo mkdir /mnt/nas1
sudo chown $USER:$USER /mnt/nas1
mkdir /mnt/nas1/various

sudo nano /etc/fstab

# add at bottom
//nas1.localnet/various /mnt/nas1/various cifs vers=3.0,credentials=/etc/nas1.credentials,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0
sudo mount -a

ls -la /mnt/nas1/various