One problem I had with running Debian servers is the inability to easily auto mount SMB shares in order to store and backup data to a central NAS.
After a while of confusing research, I finally found a way to configure fstab to auto mount my SMB shares.
In your fstab file, you can add a line such as this:
//[NAS IP Address]/[SMB Share Location i.e. /public/backup] /[Where you wish to store this SMB folder on your debian based machine] cifs username=[SMB Username],password=[SMB Password],uid=[Desired Debian User to have access],gid=[Desired Debian Group to have access],iocharset=utf8 0 0
That’s a lot of information, possibly confusing at first, so here’s an example:
//127.0.0.1/public/backup /var/smbbackup cifs username=debian, password=password, uid=debianUser, gid=smbWrite, iocharset=utf8 0 0
FYI: You can have multiple users (uid) and groups (gid) in the same fstab mount
This is just a little impromptu how-to guide for something I occasionally forget, so I hope this helps someone!
