Samba configuration and log configuration With recycle bin

Samba configuration and log configuration With recycle bin

samba-configuration-and-log-configuration-with-recycle-binInstalling samba package:

# yum install samba

Service:-
/etc/init.d/smb start|stop|reload|status

Linux Firewall (iptables) has to be configured to allow Samba traffic.
# firewall-cmd –enable –service=samba

Create share directory:
# mkdir /biswa

Samba configuration file:
vi /etc/samba/smb.conf
edit
workgroup = MYGROUP

[bamba]                ———–> last line
path = /biswa
writeable = yes
public = no
browseable = yes
valid users = admin

:wq

create samba password for login:-
smbpasswd -a admin

If Selinux policy is enabled then we should execute the following command.
chcon -t samba_var_t /biswa -R

Test the samba configuration file for any errors.
# testparm

Then restart smb service.
# /etc/init.d/smb restart

Log configuration :-

# vim /etc/samba/smb.conf
add the following lines

vfs objects = full_audit
full_audit:prefix = %u|%I
full_audit:success = mkdir rename unlink rmdir open         # Note if we want more option “man -k samba” in that man vfs_full_audit
full_audit:failure = none
full_audit:facility = LOCAL7
full_audit:priority = NOTICE
:wq

Basically we use rsyslog so We should add one entry in /etc/rsyslog.conf file,

vim /etc/rsyslog.conf
add the following line
if $syslogfacility-text == ‘local7′ and $programname == ‘smbd’ then /var/log/samba/log.audit
:wq

then restart rsyslogd
/etc/init.d/rsyslog restart

Recycle configuration:-

If we want deleted files in samb share then we enable “vsf object = recycle” this module.
#vim /etc/samba/smb.conf
add the following line
vfs objects = recycle
recycle:repository = /wang/%U
recycle:keeptree = yes
recycle:versions = yes

Then we should put below entry for every share like

[share-name]
path = /biswa/massive
public = no
writable = yes
valid user = arun,biswa
vfs objects = full_audit recycle

[Note] :- log path     = /var/log/samba/log.audit
recycle path = /wang/

 

===========================>  Blass  <=============================




2 thoughts on “Samba configuration and log configuration With recycle bin

  1. fred

    I was reading through a few of your posts on this site and I believe this website is rattling informative! Retain putting up.

    Reply
  2. samsung

    I’m lucky that I discovered this web site , precisely the right information that I was searching for! .

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *