Setting Up Server
-
2. Installing Samba Server
Then to Install Samba Server on CentOS
Simply play:sudo dnf install samba*
Authenticate with the User Admin Pass.
If Got “User is Not in Sudoers file” then see: How to Enable sudo.
This Setup includes the Utilities for File and Printer Sharing. -
3. Configuring Samba Server
Then Edit the Samba Config File
With:sudo nano /etc/samba/smb.conf
To Quick enabling a generic Read Only access with No Security use:
[sharing] comment = Sharing Directory path = /home/[myUser]/Public browseable = yes read only = yes guest ok = yes
Just Replace [myUser] with your Real username you can Check running:
whoami
This to enable the default Sharing Location in your Home Folder.
Else for a Password protected Access append:[sharing] comment = Sharing Directory path = /home/[myUser]/Public browseable = yes security = user/nencrypt passwords = yes
And to make a Writable Share set “writable = yes” in the Configuration.
Moreover, if you store sentitive Data and you have a Static IP then you should limit the allowed Hosts appending something like: “allow hosts = 127.0.0.1 192.168.1.0/24”.
Last, to Add you User to the Samba enabled Users play:sudo smbpasswd -a `whoami`
This to setup a Login for your current Username (Set a Different Password that for Admin if you Share it!)
Ctrl+x to Save & Exit from nano Editor :) -
4. Setting up Firewall
Now to Configure SELinux & Firewall
Run one by one:sudo setsebool -P samba_export_all_rw on
sudo firewall-cmd --add-service=samba --permanent
sudo firewall-cmd --reload
-
5. Enabling Samba Server
Then to Enable Samba & Winbind Services
Simply play:sudo systemctl enable smb nmb
sudo systemctl start smb nmb
-
6. Looking up Server IP
Find the Server IP on Terminal.
ip a
Find the Server IP often under eth0 on the inet Line:
Contents