I have implemented SAMBA server in my organization; Let me give detail about scenario

I have created
2 folder name abc-common and xyz-common
2 group abccommon and xyzcommon

now i want if user of abcommon goes to xyz-common and create one folder then owner and may of abcommon but group owner should xyzcommon only.

Please guide me.
Sanjeev jhaAsked:
Who is Participating?
xeroxzeroxConnect With a Mentor Commented:
install samba
#yum install samba* -y

Configure a fully accessed anonymous share
# mkdir -p /make a dir
# chmod -R 0777 /dir name

Edit and add the following lines in samba config file as shown below
vi /etc/samba/smb.conf

unix charset = UTF-8
dos charset = CP932
workgroup = WORKGROUP
hosts allow = 127. 192.168.1.
security = share

path = /your share dir
writable = yes
browsable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777

Start samba server
/etc/init.d/smb start
/etc/init.d/nmb start
chkconfig smb on
chkconfig nmb on

Test the Samba server
We can test the Samba server configuration using the command ‘testparm’.

Allow Samba server through firewal
# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
-A INPUT -s -m state --state NEW -p udp --dport 137 -j ACCEPT
-A INPUT -s -m state --state NEW -p udp --dport 138 -j ACCEPT
-A INPUT -s -m state --state NEW -p tcp --dport 139 -j ACCEPT
-A INPUT -s -m state --state NEW -p tcp --dport 445 -j ACCEPT
-A INPUT -s -m state --state NEW -p tcp --dport 901 -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

Restart iptables to save the changes
service iptables restart

Now you are able to share

Configure a authenticated share using samba server
# useradd user1
# groupadd smbgroup
# usermod -a -G smbgroup user1
# smbpasswd -a user1
New SMB password:
Retype new SMB password:
Added user user1..

for set permission do it
# mkdir /samba/share2
# chmod -R 0755 /share2/
# chown -R user1:smbgroup /share2/

Add the below lines at the bottom of samba config file.
[root@sambaserver ~]# vi /etc/samba/smb.conf
path = /share2
writable = yes
browsable = yes
guest ok = no
valid users = @smbgroup

run testperm and restart the samba service
All Courses

From novice to tech pro — start learning today.