Samba(SMB) Setup¶
Setting up SMB Server on Linux¶
Install the samba tool on Linux.
Edit the /etc/samba/smb.conf
nvme_share
is the name of the Samba path which will appear in SMB clients and its path is accessed by \\192.168.0.1\nvme_share
path
is the location where the files are stored
browseable
and read only
are flags that are needed to make sure read/write access on the SMB share
Lastly, add the user and password for the SMB share
In the case when Windows fail to write files in the samba share for odd reason. Go to Manage Credentials
-> Windows Credentials
-> Add a Windows Credential
and fill the necessary address, username and password.
Setting SMB Client in Linux¶
Install required apps
Make the required folders for mounting SMB drive.
Create a credential file for the server.
- put it in a root folder directory eg
/root/.server-smbcred
- the file must be owned by root with 600 permission
Test the mount
- make sure to set the
uid,gid,dir_mode,file_mode
so the files are not owned by root and not writable
FSTAB permeant mount /etc/fstab
//10.10.120.16/tv_2_share /mnt/cifs/tv2 cifs credentials=/root/.mediaserver-smbcred,uid=1000,gid=1001,file_mode=0755,dir_mode=0755 0 0