LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux > 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

Tags used in this thread
Popular LQ Tags , , , , , , , , ,

Reply
 
Thread Tools
Old 08-28-2006, 10:59 PM   #1
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Thanked: 0
samba: permission for sharing public and private folder


[Log in to get rid of this advertisement]
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?
zamri is offline  
Tag This Post , , , ,
Reply With Quote
Old 08-29-2006, 01:52 AM   #2
centauricw
Member
 
Registered: Dec 2005
Location: Atlanta GA
Distribution: Slackware and CentOS
Posts: 208
Thanked: 0
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.
centauricw is offline     Reply With Quote
Old 08-29-2006, 04:58 AM   #3
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Thanked: 0

Original Poster
ok thanks. I try it first.
zamri is offline     Reply With Quote
Old 09-06-2006, 07:15 AM   #4
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Thanked: 0

Original Poster
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 08:20 AM..
zamri is offline  
Tag This Post , , ,
Reply With Quote
Old 09-07-2006, 08:09 AM   #5
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Thanked: 0

Original Poster
can someone give me some directions?
zamri is offline     Reply With Quote
Old 09-08-2006, 10:50 PM   #6
centauricw
Member
 
Registered: Dec 2005
Location: Atlanta GA
Distribution: Slackware and CentOS
Posts: 208
Thanked: 0
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.
centauricw is offline     Reply With Quote
Old 09-11-2006, 06:36 AM   #7
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Thanked: 0

Original Poster
tq centauricw. I got a question:

What if I want to allow my clients to change their own passwords? If that possible?
zamri is offline     Reply With Quote
Old 09-12-2006, 01:39 AM   #8
centauricw
Member
 
Registered: Dec 2005
Location: Atlanta GA
Distribution: Slackware and CentOS
Posts: 208
Thanked: 0
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.
centauricw is offline     Reply With Quote
Old 09-12-2006, 10:12 PM   #9
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Thanked: 0

Original Poster
o really? which HOWTO? I've read one in TLDP but that one does not mention about the chat settings. Anyway thanks.
zamri is offline     Reply With Quote
Old 09-13-2006, 02:02 PM   #10
centauricw
Member
 
Registered: Dec 2005
Location: Atlanta GA
Distribution: Slackware and CentOS
Posts: 208
Thanked: 0
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.
centauricw is offline  
Tag This Post ,
Reply With Quote
Old 09-15-2006, 06:17 AM   #11
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Thanked: 0

Original Poster
ok. thanks.
zamri is offline     Reply With Quote
Old 09-19-2006, 01:48 AM   #12
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Thanked: 0

Original Poster
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 02:09 AM..
zamri is offline     Reply With Quote
Old 04-02-2007, 02:03 AM   #13
malor
LQ Newbie
 
Registered: Feb 2007
Posts: 5
Thanked: 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.
malor is offline     Reply With Quote
Old 09-26-2007, 12:27 AM   #14
balackcheng
LQ Newbie
 
Registered: Sep 2007
Posts: 4
Thanked: 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?
balackcheng is offline     Reply With Quote
Old 02-02-2009, 12:44 AM   #15
npubudu
LQ Newbie
 
Registered: Oct 2006
Posts: 19
Thanked: 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?
npubudu is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


All times are GMT -5. The time now is 09:44 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration