SAMBA – ഫയല്‍ ഷയറിങ്ങ്

Samba sharing use for sharing between linux and windows machines

port 137,139,138,445

configuration file /etc/samba/smb.conf

samba sharing can be of two types public and non public with username and passwd

1.public sharing

vim /etc/samba/smb.conf

74 workgroup = MYGROUP
75 server string = Samba Server Version %v

79 interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
80 hosts allow = 127. 192.168.12. 192.168.13.

last 8 lines
[public]
comment = Public Stuff
path = /smb
public = yes
writable = yes
printable = no
write list = +staff
browseable = no

here work group must be capital
server string is the name by which we select the sambaserver
interfaces as per needed
hosts allowed as per needed
later the share name in square bracket its the name by which we select the samba share from the server
path path to the directory
public yes for the public connection
browseable yes to enable browsing

here we are sharing the /smb directory,we should set the context,sebool and setfacl as need
—->chcon -t samba_share_t /smb
—->setfacl -m u:nobody:rwx /smb
and give needed sebool
getsebool -a | grep smb
getsebool -a | grep samba

2.Non public sharing

for a non public sharing the public tag should be no and we should add following tags from lines 252 to last part

valid users = ram

and we need to setfacl for ram to the directory /smb
—->setfacl -m u:ram:rwx /smb

and we need to give smbpasswd

smbpasswd -a ram
smbpasswd -e ram

-a for adding the user to samba users and -e to enable the samba passwd

we could see the hosted samba server by
smbclient -L 192.168.122.1 <———IP of server

client part
1.public
smbclient -L 192.168.122.1

smbclient //server_string/sharename

2.Non public users

smbclient //server_string/sharename -U username

 

 

OR

 

 

[root@lan ~]#

yum -y install samba

[root@lan ~]#

mkdir /home/share

[root@lan ~]#

chmod 777 /home/share

 

[root@lan ~]#

vi /etc/samba/smb.conf
# near line 66: add
unix charset = UTF-8
dos charset = CP932
# line 90: change (Windows’ default)

workgroup =

WORKGROUP
# line 96: uncomment and change IP address you allow

hosts allow = 127.

10.0.0.
# line 124: change (no auth)

security =

share
# add at the last line
[Share]

# any name you like

path = /home/share

# shared directory

writable = yes

# writable

guest ok = yes

# guest OK

guest only = yes

# guest only

create mode = 0777

# fully accessed

directory mode = 0777

# fully accessed

share modes = yes

# warn if some people access to a file

[root@lan ~]#

systemctl start smb.service

[root@lan ~]#

systemctl start nmb.service

[root@lan ~]#

systemctl enable smb.service

[root@lan ~]#

systemctl enable nmb.service

ഒരു മറുപടി കൊടുക്കുക

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / മാറ്റുക )

Twitter picture

You are commenting using your Twitter account. Log Out / മാറ്റുക )

Facebook photo

You are commenting using your Facebook account. Log Out / മാറ്റുക )

Google+ photo

You are commenting using your Google+ account. Log Out / മാറ്റുക )