LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-23-2011, 06:04 AM   #1
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
how to allow a single user to acces all other shared dir in samba fileserver


hi
i need help in samba file server which is in my network.
it is accessed mainly by window xp/7 users.
i need to give one user full access over all samba shared dir.in a way that this user can acess other dir.but rest of user cannot access eachother dir.

my all samba share dir is protected with permission.so no other user can access with out password.

so what should i change in smb.conf so that particular user can access all share dir.

Last edited by centos123; 09-23-2011 at 06:08 AM.
 
Old 09-23-2011, 01:05 PM   #2
Felipe
Member
 
Registered: Oct 2006
Posts: 302

Rep: Reputation: 32
Hallo:

One way can be using ACL:

1- When you configure Samba, in smb.conf, put:

Quote:
...
create mask = 0700
directory mask = 0700
inherit permissions = Yes
inherit acls = Yes
map acl inherit = Yes
...
[data]
comment = Share for data on the server....
path = /data
volume = data

Reload samba
# service smb reload
2- Enable ACL in the partition (if ext3, ext4) by modifying /etc/fstab
Quote:
Ex: For a partition /data
/dev/sdb1 /data ext4 acl,user_xattr

Remount the partition with:
mount -o remount /data ( or the partition we are going to use with ACL).
3- Assign permissions to folder and directories. Some samples (PLEASE, ARE SAMPLES, SO BE CAREFUL)
Quote:

- Allow whole access to user root and nothing to group and others
chown -R root: /data
chmod -R 700 /data

- Allow "folder1" and its content access for read to all users of domain.
setfacl -R -m g:"Domain Users":rx /data/folder1
setfacl -R -d -m g:"Domain Users":rx /data/folder1

- Allow "folder2" and its content access to all users of DA group "group2" for rw.
setfacl -R -m g:group2:rwx /data/folder2
setfacl -R -d -m g:group2:rwx /data/folder2

- Allow shared "/data" and its content whole access to a user of AD called "Administrator".
setfacl -R -m u:administrator:rwx /data
setfacl -R -d -m u:administrator:rwx /data

- See current ACL for folder1
getfacl /data/folder1

- Delete all ACL for folder2 and its content.
setfacl -R -b /data/folder2
The first line of each sample, applies to existing data. The second (with -d option), means default, what is going to be applied to new file/folders.

Is important to know that ACL are used for Samba Shares and Local access. So if a user connects to the machine using ssh, telnet, ... the same security is used.
In this way, what you really do is assigning permissions to the folders/files and say samba to use that security.

When I say "group" and "user" of domain, is possible that you have to put the domain of the user/group depending of the configuration of samba. So really, previous commands should be:
Quote:
setfacl -R -d -m g:DOMAIN\\group2:rx /data/folder2
with "DOMAIN" the name of the domain in AD.
Another way for changing permissions, is to use explorer from a Windows Client (if the users has the necessary rights, of course) as if it were a Windows Share.

Regards

Last edited by Felipe; 09-23-2011 at 01:14 PM.
 
Old 09-24-2011, 12:03 AM   #3
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
iam not using AD ...its just a samba server for sharing dir.
 
Old 09-24-2011, 12:21 AM   #4
santosh.love36
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
i am still trying how to configure samba server in centos but not getting success yar ,,, dnt know where i do changes in vi /etc/samab/smb.conf
 
Old 09-24-2011, 03:51 AM   #5
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
well, perhaps you need to install it first (yum install samba) ?
 
1 members found this post helpful.
Old 10-03-2011, 06:58 AM   #6
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
iam already working on samba ...centos os...
my smb share is working fine..but i need some changes in with one user smb setting.i want to make one samba user as admin so that he can access all smb users shared dir and file.without password..prompt...
so is their is any way to provide such permission .............
 
Old 10-10-2011, 04:05 PM   #7
Felipe
Member
 
Registered: Oct 2006
Posts: 302

Rep: Reputation: 32
As I've told you, you can use ACL (are independent you use Active Directory/Ldap or not).

Give that user permission with ACL as the samples I've put (intead ofr "Domain user" will be root or admins...).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Active Directory User integration with Samba fileserver in CentOS 5 sonjoyraha Linux - Server 2 05-25-2011 06:25 AM
Samba cannot shared /home/username/download dir trever Linux - Newbie 2 02-11-2011 04:05 AM
[SAMBA] Allow access to a directory only to a single user lucazorzi Linux - Server 1 06-30-2010 04:00 PM
Access shared samba dir that is on other partition ALInux Linux - Networking 1 04-02-2006 11:02 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration