Link to home
Start Free TrialLog in
Avatar of conti
conti

asked on

Folder sharing from Linux to Windows

We have just installed a Linux file-server to replace a WinNT server. In Windows NT we had a directory structure with folders for home users and public folders for some important files. Every user has the only right to read/write his/her home folder and read the public folders. And the adminstrator has the right to access ALL folders in the system. But also you have the ability to give access to other users to a file or folder.

For example: User1, User2, User3, Administrator
-User1 has a folder called Folder1
-User2 has a folder called Folder2
-User3 has a folder called Folder3
-The system has 1 public folder called Public
-User1 can access Folder1 and Public
-User2 can access Folder2 and Public
-User3 can access Folder3 ans Public
-User1 cannot access Folder2 nor Folder3
-User2 cannot access Folder1 nor Folder3
-User3 cannot access Folder1 nof Folder2
-The User2 give User1 the privilege to read/write Folder2
-Now, User1 can read/write Folder2
-Administrator give User3 the ability of full access to all folders
-Now, User3 can access ALL folders in the system.
(Let's say that User3 is an Administrator also)

How can I do this in Linux? Because I can do all the directory structure but just the root can access all the folders and I need the ability to grant access to specific users to write in Public folders, the other users to read and to have some users that can access read/write ALL folders. Like in WINNT.

I'm using the lastest version of SAMBA and LINUX 7.0
Avatar of dorward
dorward

I think you can use groups. (not sure though as I've never done it myself)

Give read and write permission to certain groups and add users to those groups. You might want a different group for each directory.
it's as dorward said: use UNIX groups.
just remove permissions on the folders for group and world, that's it.
With Samba (smb.conf) you can even more restrict access to (samba-)users, see man smb.conf (Keywords: guest ok, public, writable, browsable, create mask, valid users); probably this is enough to archieve what you need, but can only done by admins (of smb.conf)

BUT
 > The User2 give User1 the privilege to read/write Folder2
this is not possible with standard groups functionality, a user may just give permissions to a group or world, but not a specific user (except that user is the only member of a group).
If you realy need a permissions per user basis, you need ACLs for your filesystem on Linux too.
wait, AFAIK Samba can be configured such as a user may admin his share with his privileges, without requiering admin permissions.

Never tried it, but if you look at smb.conf, there is a include directive, so if you define your [homes] section like:

[homes]
  comment = user's private home
  include = /home/%U%/my-smb.conf

and /home/%U%/my-smb.conf is readable/writable by the (samba-)user only, and contains what you like here.

At least on dragon needs to be beated:
  after changing my-smb.conf by the user (or admin), the user must disconnect from Samba, so that due to the next connection the my-smb.conf is read again
Avatar of conti

ASKER

So, there isn't a easy way to do this as in WinNT. The reason that I'm trying to do this is because the group of users save a lot of files in the File server, but sometimes some files have virus and I'm responsible of detecting those virus and removing them. But if (with my windows) I can't access all folders (without using root) then I cannot use an anti-virus program to scan all the files. In WinNT I had an anti-virus installed in the server and it scanned every weekend all the files, but with this I cannot do this (even if I install the anti-virus in other computer). Is this correct?
Avatar of conti

ASKER

Or, is there a way to give User1 the privileges that root has? at least for the folders?
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of conti

ASKER

Seems to be no easy solution for this. I appreciate your comments.