LinuxQuestions.org
Visit Jeremy's Blog.
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 08-01-2012, 04:11 AM   #1
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
samba file server Permission in client windows pc


iam using centos 5.4 and configure samba as fileserver.Actually i had one requirement of a windows user that - dir which is share (/home/user)has 4 dir in it.and he want to give full access to one dir among them.This share is password authenticated and while providing passwd it open full access to all.

My requirement is that- i want to give full permission to one folder only for all other windows users.so they can access only that folder and denied other folder (after providing password to share)
 
Old 08-22-2012, 05:46 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: San Bernardino, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 261

Rep: Reputation: 52
Greetings,

I just want to make sure that I understand the situation here:
  1. A directory, which is a user's home directory, has 4 subdirectories.
  2. The user in question wants *all* password-authenticated windows users to be able to access only one subdirectory, but they will have full-access to that subdirectory.
  3. The user, however, wants to have full-access to all 4 subdirectories when he is authenticated and connected.

Is this correct? If so, I would think that 2 share definitions in smb.conf should do it for you... For an example, let's say the user is 'john', then in the share definition section, you would add something like:
Code:
[johns_home]
     path = /home/john
     comment = John's home dir
     browseable = no
     writable = yes
     valid users = john
     guest ok = no

[johns_docs]
     path = /home/john/docs
     comment = John's docs
     browseable = yes
     writable = yes
Or am I missing something?

HTH. Let us know.
 
Old 08-24-2012, 02:23 AM   #3
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
thanks ....
1.i already tried this structure but their is one problem
what u mention in second dir [johns_doc] will show only "johns" dir while accessing share from windows but it doesnot mention who belongs to this dir.Thats why i dropped this share.

2. My post is might not cleared fully.let me tell u once again.

Iam taking about Fileserver- samba server .in which windows user(client) access share folder of linux shared dir from their own pc.all windows user(client) have account in server.and their home dir are shared to save data from windows pc.
one user had 2 sub dir in shared dir.in which one dir is for all to share data and second is not for sharing with all.

now permission should be like that share dir have full access to all and remaining should be denied while try to access.only owner can access all dir.
 
Old 08-24-2012, 03:32 AM   #4
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Have you tried using setfacl and chmod to assign relative permission to those folders you want to be accessible or blocked for your client users.

Give required read and write permission on the sub directory and set acl for the user you want to give limited for full privilege.
 
Old 08-24-2012, 08:34 AM   #5
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
i dont know about setfcl and i tried with chmod and applied .its working also.but the parent dir is open now . i want to do this login permission in parent dir means parent share dir.

ex-/home/parent
this is share folder in linux.and have sub directory .chmod is applied to sub folder and working fine and i required login permission in parent dir.that is not working ..
 
Old 08-24-2012, 08:50 AM   #6
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
It would be really helpful if you take one post to explain yourself properly. It would be better if you use examples because it is only getting confusing with your requirements.

But for setfacl

put all the windows users in one group and if you want to give full permission to a particular directory
Code:
#setfacl -m g:windows:rwx /path to folder
and if still I am missing something then kindly use some example to show what you want to do.
 
Old 08-24-2012, 11:34 PM   #7
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
ok let me explain once.

[deepak]
path = /home/deepak
writeable = yes
; browseable = yes
guest ok = yes



here deepak is windows user and linux user also but he works in windows not linux.like this there are 30 user.and all user home dir of linux is shared to save data from windows in linux.

now assume that deepak dir is parent dir and have 2 sub-dir in it.
/home/deepak/
dir1 dir2

deepak want to share dir2 full permission to other windows user form " Run-//ip address of linux server" .
but he also want to restrict dir1 from other windows user while opening share folder.

i done it with chmod but my samba file have been configure with security = share
so when ever win user access other share it will ask for permission.

i think now it will be clear....hope so.




Quote:
Originally Posted by deep27ak View Post

But for setfacl

put all the windows users in one group and if you want to give full permission to a particular directory
Code:
#setfacl -m g:windows:rwx /path to folder
.

i didnot get this command like windows written here.what does it mean?
 
Old 08-25-2012, 12:49 AM   #8
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Well I hope I have understood. Please let me know if this is what you want.
Using this all your windows users will be able to access deepak's home directory including test1 but not test2.

Code:
#cd /home/deepak
#ls
test1 test2
Code:
#chmod 700 test2
and make sure the owner of test2 is deepak and no other user have any permission on this directory

Code:
drwxr-xr-x  2 deepak deepak 4096 Aug 25 11:04 test1
drwx------ 2 deepak deepak 4096 Aug 25 11:04 test2
Code:
#vi /etc/samba/smb.conf
[HOME]
path = /home/deepak
share modes = yes
browseable = yes
writable = yes
guest ok = no
guest only = yes
create mode = 0777
directory mode = 0777
Code:
#service smb restart
#service nmb restart
 
Old 08-29-2012, 04:12 AM   #9
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
i did this.......
i make one more share dir inside parent shared dir...and given permission as i needed.this solve my requirement.but by the client side it is closed but i am not satisfied and still trying to find another option for this requirement..

well thanks deepak for being with me to solve this requirement....one thing i want to ask what does this code do..
create mode = 0777
directory mode = 0777
 
Old 08-31-2012, 12:14 PM   #10
ShadowCat8
Member
 
Registered: Nov 2004
Location: San Bernardino, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 261

Rep: Reputation: 52
Greetings,

Code:
create mode = 0777
That sets a mask for the creation of files within the share for all who connect to the share. That mask forces the files created in the share to give everybody who connects to the share read, write and execute permissions for the files.

Code:
directory mode = 0777
And this one does it for the directories.

From the man page for smb.conf:
Quote:
Originally Posted by man smb.conf
...<snip>...
create mode

This parameter is a synonym for create mask.

create mask (S)

When a file is created, the necessary permissions are calculated according to the mapping from DOS modes to UNIX permissions, and the resulting UNIX mode is then bit-wise ŽANDŽed with this parameter.
This parameter may be thought of as a bit-wise MASK for the UNIX modes of a file. Any bit not set here will be removed from the modes set on a file when it is created.

The default value of this parameter removes the group and other write and execute bits from the UNIX modes.

Following this Samba will bit-wise ŽORŽ the UNIX mode created from this parameter with the value of the force create mode parameter which is set to 000 by default.

This parameter does not affect directory masks. See the parameter directory mask for details.

Note that this parameter does not apply to permissions set by Windows NT/2000 ACL editors. If the administrator wishes to enforce a mask on access control lists also, they need to set the security mask.

Default: create mask = 0744

Example: create mask = 0775
...<snip>...
HTH. Let us know.
 
  


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
Linux client -> Linux server 'Permission denied' when copying file to samba share spengilley Linux - Networking 2 05-02-2011 10:11 AM
CentOS /Samba server- XP Windows client file sharing issue 3phoenix Linux - Server 7 11-06-2009 11:05 AM
Why don't I have write permission to a Samba server from a Windows 2003 client. andy820303 Linux - Newbie 7 02-23-2009 09:44 PM
samba: windows file access permission kool_kid Red Hat 5 09-25-2007 02:01 PM
Samba as File & Printer Server with Windows XP Pro as client FrontRunner Linux - Newbie 0 08-17-2004 04:45 AM

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

All times are GMT -5. The time now is 08:31 PM.

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