Crisman's picture

Hi all,

 

I'm newbie on TKL Fileserver, after installing the appliance I was trying to setup some shares to use with windows, I was able to create and enter the shares but when trying to copy files or create directories inside the shares I get the message "you need permission to perform this action". On the "File Share Defaults, security and access control" I used Guest access and writable=yes, I need to have full users access to this share, could someone guide me on this permissions issue?

 

Thanks.

Forum: 
Jeremy Davis's picture

Just like in Windows there are both File permissions (in TKL this relates to the Linux users) and Share permissions (in TKL this relates to the Samba users). So you need to ensure that users have the appropriate File and Share permissions.

I'm not sure whether it's the best way, but back when I used to admin Windows servers I used to use the share level permissions to set access (i.e. either the users had all rights or none) and then file level permissions to handle read/write access.

When I started using Linux/Samba I transposed that way of working straight to Linux/Samba. So I use Samba permissions to allow read access (or not) then use file permissions to define read/write access (as appropriate). So when I configure Samba I either allow users all rights (read/write/everything) or don't give them any access at all. You then decide whether they can read/write or read only via the Linux file permissions.

In your case it sounds like you have successfully configured your Samba users and their permissions, but haven't allowed them write access at a file level.

Does that clarify it for you? If you need more pointers then post back and I'll see if I can explain more/better.

Crisman's picture

Hi, Thanks for your reply.

 

Whats making me confused is that I don't know where to set the file permissions? How this can be done?

I've also set a share (samba) limited to a specified user, and when trying to access that share on windows it ask for a user/password, I then enter those details but is always saying "Logon failure: unknown user name or bad password" but I'm sure the username and password is correct. what I'm doing wrong or what are the correct steps to set limits to some users on samba shares?

 

Thanks.

Jeremy Davis's picture

File permissions can be set either at the commandline (my personal preference; using the chown and chmod commands) or within Webmin with File Manager (Tools >> File Manager).

chown (change ownership) and chmod (change mode) are pretty straight forward commands. Use chown to change the owner (user:group), e.g.:

chown -R username:smbusers /srv/storage/user-folder

Will change the ownership of /srv/storage/user-folder and all contained files and folders (the -R switch = recursive) to a user called 'username' and the group called 'smbusers'.

and chmod is used to change the permissions (in the form of a 3 digit number that relates to owner/group/all), e.g.:

chmod -R 740 /srv/storage/user-folder

Will change the permissions of /srv/storage/user-folder and all contained files and folders (the -R switch = recursive) to

  • owner: read/write/execute
  • group: read only
  • everyone: no access

The number come from read=4; write=2 & execute=1; then you add them up... If you want to use commandline I suggest that you do a bit of a google. There is tons of info online.

To use Webmin, like I say it's Tools >> File Manager, then browse to the relevant folder and select it, then click the 'Info' button and set the permissions accordingly.

My suggestion is that you start with loose permissions and get it so you can connect. Then tighten the permissions to secure it...

Also

There is an (unofficial) youtube clip on adding shares to the File Server that may be of value to you here.

Add new comment