Solved

LINUX

Posted on 2013-11-21
1
422 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now