SAMBA SERVER
Samba Server is one of the powerful servers that helps you to share files and printers with Windows-based and other operating systems. It is an open-source implementation of the Server Message Block/Common Internet File System (SMB/CIFS) protocols.
Lets configure the samba in server side
Samba Server Side configuration
Step 1:
server ip:192.168.1.143installing the samba
# yum install samba
for creating public directory
# mkdir /public
# mkdir /private
to check the permissions and set into enable
# getenforce
give the files to all permissions
# chmod 777/public
# chmod 777/private
for checking the permissions
# ls -ldZ /public
# ls -ldZ /private
Step 2:
add the new users account
# useradd samba1# useradd samba2
configuration file path.
# vi /etc/samba/smb.conf
Add this entry in configuration file at the end
[global]
workgroup = WORKGROUP
netbios name = centos
security = user
[Public]
comment = Public File Server Share
path = /public
browsable =yes
writable = yes
public =yes
[Private]
comment = Private File Server Share
path = /private
browsable =yes
valid users = samba1 samba2 samba3
writelist = samba1 samba 3
save it with :wq
set samba password
# smbpasswd -a samba1
#smbpasswd -a samba2
Step 3:
check configuration#testparm
Client Side Configuration
Step 1:
install the samba client
# yum install samba-client
# yum install cifs-utils# smb smbclient -L 192.168.1.143
restart the services
# systemctl restart smb.service
# systemctl restart nmb.service
go to root directory
# cd /
for mounting
# mkdir mntsamba
# mkdir mntsamba1
Step 2:
mounting the public directory of server to client mntsamba directory
#mount -o guest//192.168.1.143/public /mntsambamouting the private directory to client
#mount -o samba1 //192.168.1.143 /private /mntsamba1
now try to create a file in the mounted directory of client and the reflection of that file will be shown in the server public directory.
Comments
Post a Comment