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 10-14-2010, 12:44 PM   #1
anantmbaddi
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
Thumbs up Setting Up Samba Server on KDE 3.4


Hi,
I need some help. I have a KDE 3.4 Server and 20 clients who access the shared folder in KDE 3.4. All the clients are Win XP. In my current configuration any user can access the files completely and can do modifications and delete the files but I want to provide authentication to few users who can have complete access and few who should have limited access.

I was thinking to use samba server for this but was not much sure about this. can anyone help me with this?

I want to know how i can give access to particular file or folder to a particular user?

How to add user so that the same user can access it in win xp client machine?

Looking forward for an early reply..

Anant
 
Old 10-14-2010, 01:28 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by anantmbaddi View Post
Hi,
I need some help. I have a KDE 3.4 Server and 20 clients who access the shared folder in KDE 3.4. All the clients are Win XP. In my current configuration any user can access the files completely and can do modifications and delete the files but I want to provide authentication to few users who can have complete access and few who should have limited access.

I was thinking to use samba server for this but was not much sure about this. can anyone help me with this?

I want to know how i can give access to particular file or folder to a particular user?

How to add user so that the same user can access it in win xp client machine?
What version/distro of Linux are you using?? And have you checked any of the Samba how-to's and setup guides you can easily find with a Google search??

All of your questions are covered in those guides.
http://www.samba.org/samba/docs/man/...TO-Collection/
 
Old 10-14-2010, 01:34 PM   #3
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Rep: Reputation: 7
Samba is a great choice for your situation. It will allow you to do what you are looking for.

First things first, if you want authentication, each user you want to authenticate MUST have a linux account on the server. So create users on your server with the same user names they use in Windows and give them the same passwords too. You will then convert these users to Samba accounts. Here is an excellent guide that can help you better understand how to do this: (scroll to the "creating user accounts" section)

http://www.brennan.id.au/18-Samba.html

You mentioned you have a share that currently everyone has full rights to and you want to only allow full rights to those who authenticate, and allow read only permission to those who do not authenticate. If I am mistaken, please give more details on what you are trying to accomplish.

Let's say I have a folder on the server located at /fileServer/accounting. I would change the permissions on this to 1775. You can do this by running this command:

Code:
chmod 1775 /fileServer/accounting
Having the 1 turns the sticky bit on (google this for further info) 7 = Owner has full control, 7 = group has full control, 5 = others have only read and execute permission. Next make sure you create a group and put each user you want to authenticate in that group. Let's say you create a group called finance. Change the ownership to root:finance by running this command:

Code:
chown root:finance /fileServer/accounting
For your smb.conf file your share would look something like this:

Code:
[finance]
   comment = whatever you want
   path = /fileServer/accounting
   read only = no
   inherit acls = yes
   create mask = 664
   directory mask = 775
give that a try, most if this was off the top of my head so I may have missed a step...I'm sure someone will correct me on it if I did.

Rich
 
1 members found this post helpful.
Old 10-19-2010, 09:57 AM   #4
anantmbaddi
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Hi Rich,

Thank you so much for your help.

As i said earlier, I have 20 clients in my network who have windows xp OS. The files and folders are on Linux KDE Server. All users now have full access to all files and folders.

I want the following configuration:-

- NO USERS SHOULD BE ABLE TO DELETE ANY FILES OR FOLDERS.
- Few users should be able to read and modify.
- Few users should be able to only view.

Most important is we need to give write access to most of the users but they should be able to DELETE ANY OF THE FILES.

Please help me out with this. Its urgent. Thank you very much for your help again.
 
Old 10-19-2010, 02:59 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by anantmbaddi View Post
As i said earlier, I have 20 clients in my network who have windows xp OS. The files and folders are on Linux KDE Server. All users now have full access to all files and folders.

I want the following configuration:-

- NO USERS SHOULD BE ABLE TO DELETE ANY FILES OR FOLDERS.
- Few users should be able to read and modify.
- Few users should be able to only view.

Most important is we need to give write access to most of the users but they should be able to DELETE ANY OF THE FILES.

Please help me out with this. Its urgent. Thank you very much for your help again.
If it's urgent, then you probably should read the configuration guides/howtos that Rich and I gave you, since they give you all the information you need to get things going.

Also, if you're having a problem, please post it, but we're not going to write your configuration files for you. Even at that, what you're posting is vague..."few users"?? Meaning what/who? Defined how???
 
Old 10-19-2010, 11:21 PM   #6
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Rep: Reputation: 7
You're probably looking for Linux ACLs it sounds like. With ACLs, you can go beyond the standard owner, group, other wrx permissions. You can create custom permissions for certain groups and users. The commands you'll be looking into are setfacl (to set the acls for certain groups and users) and getfacl (to list the current acl setting.

customizing acls can be tedious but can net you the results you just asked for, specifically allowing certain groups/users custom permissions to a file or folder, read, write, execute, delete, etc...can all be controlled.

Some examples I pulled by googleing "linux setfacl":

setfacl -m user:hope:r-- myfile.txt - Adds one ACL entry to the file myfile.txt, which gives the user hope read permission only.

setfacl -m u:saj:r--,u:leander,jake:rw- tester.txt - The command can be read as follows: Modify (-m) the access control list on the file tester.txt by giving read-only access (r--) to user (u) saj and read-write access (rw-) to the users (u) leander and jake. Conversely, you can create a group by a name say 'mygroup' and add the users leander and jake to mygroup and set the acl for the file as follows: setfacl -m g:mygroup:rw- /home/ravi/tester.txt

setfacl -m u:lisa:r file Granting an additional user read access

setfacl -m m::rx file Revoking write access from all groups and all named users (using the effective rights mask)

getfacl file1 | setfacl --set-file=- file2 Copying the ACL of one file to another

getfacl --access dir | setfacl -d -M- dir Copying the access ACL into the Default ACL

@TB0ne, have you ever had to find a solution fast, like yesterday? I know I have, and I can generally find more info on these boards faster than reading the config files that some elitist programmer wrote 12 years ago Don't always jump to the conclusion that he didn't already read the man pages/guides, and even though it was a little vague, I didn't need any more info than what he already posted to see that he was needing help with ACLs.
 
Old 10-20-2010, 07:33 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by unassassinable View Post
@TB0ne, have you ever had to find a solution fast, like yesterday? I know I have, and I can generally find more info on these boards faster than reading the config files that some elitist programmer wrote 12 years ago Don't always jump to the conclusion that he didn't already read the man pages/guides, and even though it was a little vague, I didn't need any more info than what he already posted to see that he was needing help with ACLs.
First, pay attention to his posts. A five-day lull between them doesn't scream "URGENT". And if I'm in a hurry, I don't waste time hitting the forums/boards, because that takes MORE time than reading the docs for myself.

And talk about jumping to conclusions...what's that about Linux ACLS??? You do realize that when you authenticate to Samba, via Windows, that some of what you posted, won't work, right?
 
Old 10-20-2010, 10:28 AM   #8
anantmbaddi
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you so much Rich for you help...!!!

@TB0ne: I am new samba server configuration. I need to do this configurations for one of my client. I am a Professional Ethical Hacker and Penetration Test Engineer. I do trainings on IT security courses. Well no comments on what you said.

Thank you so much for your help too...!!!


@Rich: I am still working on it. As I have many commitments, Its difficult for me to take out time. But I have already dedicated time and working on it. Will get back to you if i stuck somewhere

Thank you again...!!!
 
Old 10-20-2010, 11:45 AM   #9
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Rep: Reputation: 7
TBOne, you may be right about the ACLs and Windows. Why not suggest a solution?
 
Old 10-20-2010, 12:00 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by unassassinable View Post
TBOne, you may be right about the ACLs and Windows. Why not suggest a solution?
I did when I posted the link to the Samba documentation, where ACL's are covered. Re-typing what's already in there is a waste of time.
 
Old 11-02-2010, 03:02 AM   #11
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Rep: Reputation: 7
For your Linux users, lets say we create a folder called tech.

# mkdir tech
# chown root:tech tech - changes the owner to root, and group to tech
# chmod 0750 tech - this sets it so owner (root) has full access, and everyone in group tech has read/execute (limited access)
# chmod g+s tech - this sets the flag to s, which sets the gid
# setfacl -d -s g:techAdmin:rwx tech - this makes it so all users of group techAdmin can write to the share.
# setfacl -m group:techadmin:rwx tech/ - not sure why this needed to be there as the above code I though would take care of it. if anyone knows why, please post in the comments.



FOr Windows users, here's the samba share:

[tech]
comment = Tech department only
#inherit acls = Yes
path = /mnt/tech
guest ok = no
browseable = yes
read only = No
writeable = Yes
create mode = 0750
directory mode = 0750
force group = tech
write list = @techAdmin
valid users = @tech

This will allow all users in the group tech to read/execute and allow all users in the group techAdmin to read/write/execute.

Setting it up this way will allow users of the same group to create, modify, delete files within the tech directory. This also prevents the problem whereupon one user will create a file and automatically takes owner of it so others cant edit it.

Rich

Last edited by unassassinable; 11-03-2010 at 01:05 PM.
 
  


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
Setting up a Samba server SuperDude123 Linux - Newbie 4 06-09-2009 12:16 AM
newbie in need of help setting up a samba server roddyguk Linux - Software 4 05-05-2006 01:20 PM
Setting up a samba server Tremendo Linux - Newbie 2 07-16-2004 11:47 AM
How do I go about setting a samba server on Linux? natalinasmpf Linux - General 1 02-22-2004 01:00 PM
RH9...Where did my Samba server setting go? naloxone Red Hat 1 09-17-2003 11:45 AM

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

All times are GMT -5. The time now is 06: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