Solved

LINUX

Posted on 2013-11-21
1
426 Views
Last Modified: 2013-11-27
Hi:

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.
0
Comment
Question by:Sanjeev jha
1 Comment
 
LVL 6

Accepted Solution

by:
xeroxzerox earned 500 total points
ID: 39668064
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

[myshare]
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.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -s 192.168.1.0/24 -m state --state NEW -p udp --dport 137 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -p udp --dport 138 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 139 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 445 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 901 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -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
COMMIT

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
[secure]
path = /share2
writable = yes
browsable = yes
guest ok = no
valid users = @smbgroup

run testperm and restart the samba service
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question