How to Install and config Samba in CentOS 8
Install Firewall
#yum install -y firewalld
Install Samba Server
#yum install -y samba samba-common samba-client
============================================================
Start Service Samba
#systemctl enable smb nmb
#systemctl start smb nmb
#systemctl status smb nmb
============================================================
Add Samba to Firewall
#firewall-cmd –permanent –zone=public –add-service=samba
Reload Firewall
#firewall-cmd –reload
============================================================
Config System
vi /etc/sysconfig/selinux
SELINUX=disabled
============================================================
Create Samba Group
#groupadd Group-Name
============================================================
Create User Samba for the group
#useradd User-Name
============================================================
Add User to the group
#usermod User-Name -aG Group-Name
============================================================
Set Password for the User
#smbpasswd -a User-Name
============================================================
Check If your group and users is created
#cat /etc/group
group_name:x:1001:user_name,. . .,user_name10
user_name:x:1002:
.
.
.
user_name10:x:10012:
============================================================
Create Share folder
#mkdir -p /path/folder-name
Config for Public Folder
+Change Mode Folder
#chmod -R 0775 /path/folder-name
+Change Owner Folder
#chown -R nobody:nobody /path/folder-name
Config for Secure Folder
+Change Mode Folder
#chmod -R 0777 /path/folder-name
+Change Owner Folder
#chown -R root:Group-Name /path/folder-name
More Detail for chown: https://www.pluralsight.com/blog/it-ops/linux-file-permissions
Mount Folder
#cd /path
Enable Folder for Share with samba
chcon -t samba_share_t folder-name/
============================================================
Backup & Config Samba file
Backup
#cp /etc/samba/smb.conf /etc/samba/smb.con.bak
Configuration
#vi /etc/samba/smb.conf
============================================================
[global]
workgroup = WORKGROUP
map to guest = bad user
In the video I was disabled Home directory of the User logged in
If you’re not disable this. When Enter User and Password
One more Folder will be created and It belong to User Home directory that logged in
[Secure Folder]
comment = This is Secure Folder
path = /path/Folder-Name
writable = yes
browsable = yes
guest ok = no
valid users = User-Name, @Group-Name
Public Folder]
comment = Allow Everyone Access
path = /path/Folder-Name
browsable = yes
writable = yes
guest ok = yes
============================================================
Restart Samba Service
#systemctl restart smb nmb
============================================================
Check IP for Access folder
#ifconfig
centos 8