DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-04-16 22:38:45

Viracocha
Member
Registered: 2008-04-16
Posts: 12

Newbie questions

Hi there,

I just obtained a DNS-323 and I'm trying to implement security on it.

First off, can a user change their password without having to log in as admin and set it for them?

2nd, when trying to edit privileges to different folders, it seems that if I try to give access to the same folder to different users/groups, it creates different shares with _1/_2 appended to it. Is it possible to set preferences for a folder that contain more than one user and still keep the same share name?

Thanks in advance

Offline

 

#2 2008-04-17 15:22:29

Holden
Member
Registered: 2008-04-16
Posts: 9

Re: Newbie questions

re: user changing their own passwords

the web interface does not support this functionality but in a different way this could probably be done if users telnet login into the NAS and run chpasswd. It's not a user friendly process.

re: the folder security question

jayas asked a similar question in his post re: can users belong to multiple groups for mounting shares?. The short answer is yes. The longer answer is you have to manually modify the underlying OS user database (passwd, groups) and default samba configuration with fun_plug and the sambafix.sh script.

Offline

 

#3 2008-04-17 20:12:02

Viracocha
Member
Registered: 2008-04-16
Posts: 12

Re: Newbie questions

Thanks for the answer. I installed fun_plug and seem to be having success with setting up the share permissions the way I want it. I haven't tried the sambafix.sh yet but I'm sure it'll work properly. Being a Linux/Samba newbie as well, are there any tools to help change the smb.conf file or do you have to do it by hand like I'm doing now?

Offline

 

#4 2008-04-17 21:08:45

Viracocha
Member
Registered: 2008-04-16
Posts: 12

Re: Newbie questions

I just thought of something else. Maybe someone with better knowledge of Samba/Linux can help me out.

As I said above I can now set permissions to multiple groups/users for each share. Is it possible to restrict the creation of folders through samba? I'd like to be able to define the folder structure and make sure that this is not changed by the users. I apologize if this is something trivial, but I came up empty while looking through samba how-to.

Thanks in advance

Offline

 

#5 2008-04-18 06:40:11

Holden
Member
Registered: 2008-04-16
Posts: 9

Re: Newbie questions

re: restrict directory structure modification

I'm not sure this can be done through samba configuration but it may be more possible by setting file permissions with chmod. The chmod man page might help determine the exact setting you desire. i.e. removing group write permissions or other write permissions from a directory.

Offline

 

#6 2008-04-18 16:00:13

Viracocha
Member
Registered: 2008-04-16
Posts: 12

Re: Newbie questions

I've been looking into it that way as well but haven't found anything useful. It seems that if you give it write permissions to create files, it also allows creation of directories, and there is no way to make that distinction sad.

I have run into some problems regarding giving write access to a particular person. I have the following share in my smb.conf:

Code:

[username]
comment = 
path = /mnt/HD_a2/Home/username
valid users = @Admin @PowerUsers username
write list = username
writeable = yes
guest ok = no
oplocks =  yes
map archive = yes

It should give user username read/write access to the share, and read only access to users in groups Admin and PowerUsers. Unfortunately it doesn't seem to be doing this. It's allowing everyone in those groups write access to the share. If I set it to read only = yes, then no one has write access to it.

Any idea what I'm doing wrong?

Thanks in advance

Offline

 

#7 2008-04-19 07:43:17

Holden
Member
Registered: 2008-04-16
Posts: 9

Re: Newbie questions

The share parameters I set for separate read and write permissions were:

[ sharename ]
comment =
path = /mnt/HD_a2/publicshare
valid users = @sharegroup-RW, @sharegroup-RO
read list = @sharegroup-RO
write list = @sharegroup-RW
read only = no
guest ok = no
oplocks = no
map archive = no

I confirmed this to work as desired, providing read access for members of the group 'sharegroup-RW' and write access for members of the group 'sharegroup-RW'.

Offline

 

#8 2008-04-21 15:26:45

Viracocha
Member
Registered: 2008-04-16
Posts: 12

Re: Newbie questions

I managed to fix it. Setting it to writeable = yes apparently ignores the write list and gives write access to all valid users:

Code:

[username]
comment = 
path = /mnt/HD_a2/Home/username
valid users = @Admin @PowerUsers username
read only = yes
write list = username
guest ok = no
browseable = No

That seems to be working well. Read access to both groups and the user, and write access only for the user.

Thanks for the help smile

Offline

 

#9 2008-04-21 16:11:59

Holden
Member
Registered: 2008-04-16
Posts: 9

Re: Newbie questions

Glad to see you got settings that work. You helped clarify the 'writeable'/'read only' setting(s) define default access rights which can thereafter be further modified with the 'write list'/'read list' settings. Neither the smb.conf man page nor the O'Reilly Using Samba documentation clearly state the order of precedence for these settings. The sample I posted could be improved <groan>.

The paragraph 'read only (S)' in the smb.conf man page states 'read only = yes' is the default so theoretically it's not even necessary to specify that setting. Better to be safe than sorry however ...

Offline

 

#10 2008-04-23 16:45:56

Holden
Member
Registered: 2008-04-16
Posts: 9

Re: Newbie questions

I'm learning as I go and remembered your earlier question ...

Viracocha wrote:

Is it possible to restrict the creation of folders through samba? I'd like to be able to define the folder structure and make sure that this is not changed by the users.

I found two ways to do this, both by setting folder permissions and smb.conf settings.

bulliver posted a Quick and Dirty Guide to Linux File Permissions at linuxquestions.org

bulliver wrote:

THE STICKY BIT

Linux directory access permissions say that if a user has write permissions on a directory, they can rename or remove files there,even if the files don't belong to them.
When the owner of the directory sets the sticky bit, renames/removals are only allowed by the files owner, the directories owner and the root user.

zacch posted another method, How to restrict user deleting folder via samba at linuxforums.org

zacch wrote:

to prevent deleting a directory

you need to set non-writable the parent of this directory

e.g. to prevent people from deleting the two folder under: /one/two

you need to set /one to chmod 755

then nobody can create or delete subfolders under /one, except the owner of one

one: 755
two: 777

then anyone can create/delete files inside two, but cannot delete the folder two

Either of these methods can be complimented with creation mask settings in smb.conf settings for new files/folders to persist the settings.     Chapter 8. Advanced Disk Shares of the online O'Reilly Using Samba book has a short illustration of settings that would compliment the second method.

Code:

[data]
    path = /one
    create mask = 744
    directory mask = 755
    force user = joe
    force group = accounting

Hope this helps.

Offline

 

#11 2008-04-23 18:42:00

Viracocha
Member
Registered: 2008-04-16
Posts: 12

Re: Newbie questions

Thanks. I'll try it out though I don't think I'll be needing it after all. Never hurts to know though.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB