FStab

Mount network shares available in GNU/Linux using the 'file system table' (fstab):

Cifs (Windows / samba)

  1. Install cifs tooling: $ apt install -y cifs-utils

  2. Create a mount-point directory: $ mkdir /mnt/<mount-point>

  3. Create a credentials file and open it for editing:$ vim /etc/samba/credentials

  4. Populate it with with the cifs credentials:

    username=<username>
    password=<password>
  5. Make the credential file read only: $ chmod 700 /etc/samba/credentials

  6. Open the mount definition file for editing: $ vim /etc/fstab

  7. Append it with the a line defining the mount (settings):

    //<192.168.1.100>/<share>/  /mnt/<mount-point>  cifs    user,sec=ntlm,credentials=/etc/samba/credentials    0   0
    • 192.168.1.100 - server's IP address or hostname.
    • share - remote folder on the server (and possibly path to it).
    • mount-point - local folder to mount to.
    • cifs - share protocol to be used.
    • user - allowing regular (non-root) users to mount.
    • sec=ntlm - overriding regular security settings (using old protocols).

      ALTERNATIVELY (needs testing):

      //<192.168.1.100>/<share>/    /mnt/<mount-point>  cifs    user,uid=<username>,credentials=/etc/samba/credentials  0   0
  8. Mount the share to the mount-point: $ mount /mnt/<mount-point>

    ALTERNATIVELY: Mount every share defined in fstab: $ mount all