LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-28-2006, 09:59 PM   #1
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Rep: Reputation: 30
samba: permission for sharing public and private folder


Hi all,

I want to setup a folder like this :

1. a public folder for all
2. a folder with only certain groups can browse only

I've read that clamav can be setup to scan accessed files on the fly.

for 1., my setup is like this :

Code:
[public]
        comment = Public Stuff
        path = /home/samba/public
        write list = @staff
        guest ok = Yes
        vfs objects = /usr/lib/samba/vfs/audit.so
I can't access the folder with error "\\Router\public is not accessible. The network name cannot be found". What did i do wrong?

For 2., my setup is like this :

Code:
[sharing]
comment = people stuff
   path = /home/samba/sharing
   valid users = mary jacob
   public = no
   writable = yes
   printable = no
   create mask = 0765
This works ok but for certain users but how to do it for certain groups of users?
 
Old 08-29-2006, 12:52 AM   #2
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
For the [public], make sure that the Linux file permissions are set so the directory is world readable. In fact, I would set the directory permissions like this:

Code:
drwxrwxr-x  root staff  /home/samba/public
Then modify the [public] share so it looks like this:

Code:
[public]
    comment = Public Stuff
    path = /home/samba/public
    read only = Yes
    write list = @staff
    guest ok = Yes
    create mask = 0664
    directory mask = 0775
    vfs objects = /usr/lib/samba/vfs/audit.so
This will make the files readable to everyone and writable only by "staff". The "create mask" and "directory mask" ensure new and modified files and directories retain their correct permissions.

For the [sharing] share, create a new group for all users that will have access to this file share. It will not be their primary group. Set the permissions on the directory like this:

Code:
drwxrwx---  root mygroup  /home/samba/sharing
Then modify the [sharing] share so it looks like this:

Code:
[sharing]
    comment = people stuff
    path = /home/samba/sharing
    valid users = @mygroup
    public = no
    writable = yes
    printable = no
    create mask = 0660
    directory mask = 0770
    force group = mygroup
This share will now only be accessable to members of "mygroup". The "create mask" and "directory mask" ensure new and modified files and directories retain their correct permissions, and the "force group" causes all file read/writes to be the group "mygroup" regardless of what the user's primary group is, ensuring that all members can read/write/modify files.

Enjoy.
 
Old 08-29-2006, 03:58 AM   #3
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
ok thanks. I try it first.
 
Old 09-06-2006, 06:15 AM   #4
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
1. what is the difference between create mask and directory mask?
2. I can send messages to Win XP client but not to Linux client running samba. I got this error :

message start: ERRSRV - ERRmsgoff (Not receiving messages.)

How to fix this?

Last edited by zamri; 09-06-2006 at 07:20 AM.
 
Old 09-07-2006, 07:09 AM   #5
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
can someone give me some directions?
 
Old 09-08-2006, 09:50 PM   #6
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
Quote:
what is the difference between create mask and directory mask?
The create mask sets the permissions that files will be created with by an SMB client. Directory mask sets the permissions that directories will be created with.
 
Old 09-11-2006, 05:36 AM   #7
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
tq centauricw. I got a question:

What if I want to allow my clients to change their own passwords? If that possible?
 
Old 09-12-2006, 12:39 AM   #8
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
This is handled by the password chat settings in the smb.conf file and detailed in the Samba HOWTO. I have never used this feature, however.
 
Old 09-12-2006, 09:12 PM   #9
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
o really? which HOWTO? I've read one in TLDP but that one does not mention about the chat settings. Anyway thanks.
 
Old 09-13-2006, 01:02 PM   #10
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
The is a wealth of documentation on the Samba web site, including free PDF/HTLM copies of Samba-3 HOWTO and Samba-3 By Example from the Bruce Perens Open Source Series. I highly recommend Samba-3 By Example as a tutorial of how to do things with Samba.
 
Old 09-15-2006, 05:17 AM   #11
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
ok. thanks.
 
Old 09-19-2006, 12:48 AM   #12
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
I have setup chat script in [global] section as below :

Code:
unix password sync = yes
passwd program = /usr/bin/passwd %u
encrypt passwords = yes

smb passwd file = /etc/samba/private/smbpasswd
passwd chat = *new*password* %n\n *new*password* %n\n *changed*
How do I change my password in Windows XP/ME client? I can't find any option.
What do I need to set at the client end? or server end?

Last edited by zamri; 09-19-2006 at 01:09 AM.
 
Old 04-02-2007, 01:03 AM   #13
malor
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Rep: Reputation: 0
I tried to sent message to FC5:
# smbclient -M smirnova
message start: ERRSRV - ERRmsgoff (Not receiving messages.)

When I tried to sent message to Win XP:
# smbclient -M Kur
Connection to Kur failed

What do I have to do ?

My machine has FC5.
 
Old 09-25-2007, 11:27 PM   #14
balackcheng
LQ Newbie
 
Registered: Sep 2007
Posts: 4

Rep: Reputation: 0
Exclusive Read permissions for others

Quote:
Originally Posted by centauricw View Post
For the [public], make sure that the Linux file permissions are set so the directory is world readable. In fact, I would set the directory permissions like this:

Code:
drwxrwxr-x  root staff  /home/samba/public
Then modify the [public] share so it looks like this:

Code:
[public]
    comment = Public Stuff
    path = /home/samba/public
    read only = Yes
    write list = @staff
    guest ok = Yes
    create mask = 0664
    directory mask = 0775
    vfs objects = /usr/lib/samba/vfs/audit.so
This will make the files readable to everyone and writable only by "staff". The "create mask" and "directory mask" ensure new and modified files and directories retain their correct permissions.

For the [sharing] share, create a new group for all users that will have access to this file share. It will not be their primary group. Set the permissions on the directory like this:

Code:
drwxrwx---  root mygroup  /home/samba/sharing
Then modify the [sharing] share so it looks like this:

Code:
[sharing]
    comment = people stuff
    path = /home/samba/sharing
    valid users = @mygroup
    public = no
    writable = yes
    printable = no
    create mask = 0660
    directory mask = 0770
    force group = mygroup
This share will now only be accessable to members of "mygroup". The "create mask" and "directory mask" ensure new and modified files and directories retain their correct permissions, and the "force group" causes all file read/writes to be the group "mygroup" regardless of what the user's primary group is, ensuring that all members can read/write/modify files.

Enjoy.
Hi Centauricw,

If let's say a few of my users - user1, user2 ,and user3 request for the READ permissions for the above folder; What should i do?
 
Old 02-01-2009, 11:44 PM   #15
npubudu
LQ Newbie
 
Registered: Oct 2006
Posts: 19

Rep: Reputation: 0
Quote:
Originally Posted by centauricw View Post
For the [public], make sure that the Linux file permissions are set so the directory is world readable. In fact, I would set the directory permissions like this:

Code:
drwxrwxr-x  root staff  /home/samba/public
Then modify the [public] share so it looks like this:

Code:
[public]
    comment = Public Stuff
    path = /home/samba/public
    read only = Yes
    write list = @staff
    guest ok = Yes
    create mask = 0664
    directory mask = 0775
    vfs objects = /usr/lib/samba/vfs/audit.so
This will make the files readable to everyone and writable only by "staff". The "create mask" and "directory mask" ensure new and modified files and directories retain their correct permissions.

For the [sharing] share, create a new group for all users that will have access to this file share. It will not be their primary group. Set the permissions on the directory like this:

Code:
drwxrwx---  root mygroup  /home/samba/sharing
Then modify the [sharing] share so it looks like this:

Code:
[sharing]
    comment = people stuff
    path = /home/samba/sharing
    valid users = @mygroup
    public = no
    writable = yes
    printable = no
    create mask = 0660
    directory mask = 0770
    force group = mygroup
This share will now only be accessable to members of "mygroup". The "create mask" and "directory mask" ensure new and modified files and directories retain their correct permissions, and the "force group" causes all file read/writes to be the group "mygroup" regardless of what the user's primary group is, ensuring that all members can read/write/modify files.

Enjoy.
Hi,

I followed the [public] share creation in above and only the alternation I did is introduce the "create mask 0674" - as I want staff group to have all the access (specially reading) but the files are creating with 664 permissoin. ???

[public]
comment = Public Stuff
path = /home/samba/public
read only = Yes
write list = @staff
guest ok = Yes
create mask = 0674
directory mask = 0775

rwxrwxrw- 2 root staff 4,096 Feb 2 11:01 public


see in ls -al /home/samba/public
-rw-rw-r-- 1 pppp pppp 222,170 Dec 8 13:24 net-snmp-perlmods-5.4.2.1-1.f9

how to make it?
 
  


Reply

Tags
documentation, folder, messages, permission, permissions, popup, samba, smb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SAMBA Public Share Folder Echo Kilo Linux - Software 3 06-17-2008 01:32 AM
Samba Public Folder Permissions decoone Linux - Networking 4 09-26-2007 12:42 AM
Samba not working as intended. Private / Public share's ILikeVoltron Linux - Networking 3 03-14-2006 04:22 PM
Samba Public shared Folder will not hold permissions xzerros Linux - Networking 12 09-26-2005 09:25 AM
Samba Public Folder DerrickCheang Linux - Newbie 3 10-29-2002 06:04 AM


All times are GMT -5. The time now is 11:54 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration