Deploy samba RedHat or CentOS 7

By definition samba is network file and print sharing service that is supported by most operating systems today. In this blog we will take a look at deploying samba server on REDHAT 7 system to share files with Windows 7 or 8 based client. The procedure will be same on CentOS, and most other distributions although location of configuration files and the way services are handled may vary. We will be sharing directory names smbshare. We will create usergroup named staff and user john

Lets get started:

Install necessary software

#yum install -y samba samba-commons cups-libs policycoreutils-python samba-client
#mkdir /smbshare
#groupadd staff
#chgrp -R staff /smbshare
#chmod -R 777 /smbshare
#useradd john
#usermod -G staff john
#smbpasswd -a john
“your password”

Add the following at the end of smb.conf file

[smbshare]
comment = shared-directory
path = /smbshare
public = no
valid users = john, @staff
writable = yes
browseable = yes
create mask = 0765
 

Staring services

 

systemctl start smb.service

systemctl start nmb.service

systemctl enable smb.service

systemctl enable nmb.service

At this point you should be able to connect to share from any windows system that has appropriate network access.