LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Samba Share for Group (https://www.linuxquestions.org/questions/linux-newbie-8/samba-share-for-group-608000/)

bgeorge 12-19-2007 09:14 PM

Samba Share for Group
 
How do i set up a Samba share so that only a specified group has full access OR specify specific users to have access? Terminal instruction please.

billymayday 12-19-2007 09:23 PM

valid users =

Terminal instructions

Open box.
Take Terminal out
Put on desk
Plug in
etc.

It's not a help desk

Read man smb.conf

neophytezer0 12-19-2007 10:47 PM

File Permissions
 
Sorry if its a little superfluous, but i got excited...

Ok, what you are wanting to change is file permissions. I will try to explain them a little, but a quick google will show up more information.

so: every file has three three-bit "octets" that assign privileges.
Code:

  xxx    xxx    xxx
 owner  group  world

You may have noticed something like a '-rwxrwxr-x' or such when you do any 'ls -l'.

So, what do those things mean?

Using the commands "chmod" and "chown" you can change the owner and the file permissions for a given file.

first off, say you want to change the owner to bob:
Code:

chown bob given_file
note: you must have sufficient privileges to change the properties of the file...

ok so now your file is owned by bob. however, say you want it to be able to be read by everyone in the "family" group? well, go on then.
Code:

chown .family given_file
now the file is owned by the family group. (notice the leading '.' that denotes the group. you can also do user and group at once, like: bob.family)

Just because you have changed the ownership of a file doesnt mean that the people that own it can automatically read it. thats where those 9 bits at the top come into play. I will try to exlain 'chmod' now:

Each of those three three-bit octets can be represented by 0's and 1's. the easiest way to do file permissions is to represent it in binary form. to do so, do this:

Situation: change the group permissions to allow read and execute, but not write. owner has full priv's, and world has read only.

ok, now think about it like this:
Code:

  rwx    r-x    r--
 owner  group  world

or
Code:

  111    101    100
 owner  group  world

ok now if you know binary, add the three together, separately.
Code:

  421    421    421
  111    101    100
 ==================
 4+2+1  4+1    4
 ==================
  7      5      4

so now all you gotta do is:
Code:

chmod 754 given_file
and your file has the right permissions.

---------------------------------------------------

Okay, now to answer your question fully.

you kinda asked the same question twice. what you should do is create a new group, like so:
Code:

groupadd name
Now that you have the group, add people to the group, like so:
Code:

useradd -G group_name user_name
then all you have to do is change the file permissions of the samba share files.


All times are GMT -5. The time now is 01:15 AM.