Mounting smb shares with no credentials

  1. Install require packate:
sudo apt install cifs-utils 
  1. Create folder to mount
sudo mkdir /media/plex
  1. Mount smb share with non-credential access:
sudo mount -t cifs -o rw,vers=3.0,guest //192.168.1.5/share /media/plex
  1. Remount on system reboot
sudo vi /etc/fstab 

Enter below value at the end of the line:

//192.168.1.5/share /media/plex  cifs  username=guest,password=,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=1  0  0

Mounting smb shares with credentials

Follow step 1 and 2 from above.

  1. Create credential file
vi /root/.mysmbcreds 

Enter values as shown in below example:

username=johnsmith
password=mysupersecretpassword
  1. Mount smb share with credentials:
sudo mount -t cifs -o rw,vers=3.0,credentials=/root/.mysmbcreds //192.168.1.5/share /media/plex 
  1. Remount on system reboot
sudo vi /etc/fstab 

Enter below value at the end of the line:

//192.168.1.5/share /media/plex cifs  credentials=/root/.mysmbcreds,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=1  0  0