LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Lubuntu File Server Permissions (https://www.linuxquestions.org/questions/linux-networking-3/lubuntu-file-server-permissions-4175445388/)

lubuntuplex 01-13-2013 06:32 AM

Lubuntu File Server Permissions
 
Hi, I'm brand new to Linux and have spent the last two days fumbling through it.
I'm at a loss on this issue though and have searched extensively but not found a clear solution.

I am running Lubuntu 12.04 on a HP Microserver N40L.
I have set up a RAID5 array (using mdadm)to store all my media.
I have managed to create a Samba share of the raid (/mnt/mdo) and can detect and browse it on my Macbook Pro (running Lion 10.7.4).

How It Works At The Moment:

--On the Lubuntu box--
*Can create folders and write data to them at the root of the Raid.
*Can only read folders/files created or copied to the share by the Mac.

--On my Macbook--
*Can create files and folders and write to them at the root of the Raid.
*Can only read folders/files created by the Lubuntu box.

How I Would Like It To Work
--On the Lubuntu Box--
*Can read and write to folders and files and all sub-directories no matter who the owner is.

--On my Macbook--
*Can read and write to folders and files and all sub-directories no matter who the owner is.

--In General--
*The same permissions as above for Windows users (read/write all) as I will be putting this microserver in a house with three windows PCs and a Mac.
*In theory I'd like to be able to take this Lubuntu box and occasionally connect it to the gigabit network at work - could users connect to it with the same desired permissions as described above?


At the moment I have to manually set permissions on a new folder in Lubuntu so that the Mac can read/write - but I need this to be automatic/default.

On the Mac there is no way to edit folder permissions of folders that I place on the Raid.

I am using Samba Server Configuration on Lubuntu.

Essentially I want this to work like a big file server on the network that anyone can connect to and read/write - even guests who bring over their computers and plug into the ethernet.

Thank you

EricTRA 01-13-2013 06:41 AM

Hello and welcome to LinuxQuestions,

How are your current Samba permissions set up? And how are the permissions on the file system level? Keep in mind:
1. Linux system permissions take precedence over Samba permissions
2. The filesystem permission cannot be take priority over Samba permission

Compare your current permissions taking into account the two rules above and check if you are complying with them. If possible post your Samba comfiguration file.

Looking forward to your participation in the forums. Have fun with Linux.

Kind regards,

Eric

lubuntuplex 01-13-2013 09:41 AM

Thanks for the swift response EricTRA.

1. I have used Webmin to check Linux permissions on the Raid [/mnt/md0]:
user: read/write/list - checked
group: read/write/list - checked
other: read/write/list - checked
sticky: only owners can delete files - unchecked.
octal: 0777
ownership user: root
ownership group: root
setgid: files inherit group - unchecked.

2. Samba Server Configuration
/mnt/md0:
permissions read/write
writable - checked
visible - checked
access - allow access to everyone - checked.

3. Webmin to check the Samba share
Under security it says read/write to everyone.


4. PCManFM to check mnt/md0 permissions:
owner: root
group: root
access control owner: read and write
access control group: read and write
access control other: read and write

Here is my samba config file (the INDIESTOR entry is a piece of software I've not yet fully configured yet so I've ignored that):

PHP Code:

#GLOBAL OPTIONS
[global]
    
security share
    unix extensions 
no
    aio read size 
1
    aio write size 
1
    workgroup 
workgroup
;    server string samba 3.6.3
;    encrypt passwords yes
;    guest ok no
;    guest account nobody


#SHARES

[indieSTOR]
    
comment IndieSTOR home directories
    browseable 
no
    writeable 
yes
    path 
= %H
    hide files 
= /.*/DesktopFolderDB/TrashFor%m/resource.frk/
    
veto = /.*/DesktopFolderDB/TrashFor%m/resource.frk/
;    
follow symlinks yes
    valid users 
= @indiestor-users
    wide links 
yes
    map read only 
permissions
    inherit permissions 
yes
    force create mode 
0750
    force directory mode 
0750
    create mask 
0750
    directory mask 
0750
    force group 
indiestor-users

[RAID]
    
guest ok yes
    comment 
Lubuntu Raid
    writeable 
yes
    create mode 
0777
    path 
= /mnt/md0
    directory mode 
0775
;    browseable yes 

I did notice that if I create a folder on the Raid on the Lubuntu box I am able to change the folder name on the Mac, but not delete it, add to the folder or delete the contents of the folder. The same applies for a folder created by the Mac and accessed by the Lubuntu box.

TO be honest I still can't understand what a group is or how it is used but I have a feeling it may be the cause of my problems?


Thank you.

lubuntuplex 01-13-2013 11:39 AM

UPDATE - NEARLY THERE:

After much more tinkering and deleting and creating the Samba share again I am now able to:
--create a folder on the Raid from the Mac and read/write it on Lubuntu.
--create a folder on the Raid from Lubuntu and read and delete it on Mac, but not write to it.

Unfortunately I've made that rookie error of not remembering what I did to get to this point but I'm here now.
I have two folders on the Raid - one called "lubuntu" which was created on the Lubuntu machine and one called "mac" created using the Mac.

Here are the default permissions.
--Permissions for "lubuntu":
owner: read and write
group: read and write
other: read only

--permissions for "mac":
owner: read and write
group: read and write
other: read and write

I cannot figure out why the 'other' permissions on the lubuntu folder default to read-only.

Once again - here is my new samba config file:
Code:

#GLOBAL OPTIONS
[global]
        security = share
        unix extensions = no
        aio read size = 1
        aio write size = 1
        workgroup = workgroup
;        server string = samba 3.6.3
;        encrypt passwords = yes
;        guest ok = no
;        guest account = nobody


#SHARES


[RAID]
        guest ok = yes
        comment = HPMS RAID
        writeable = yes
        delete readonly = yes
        create mode = 777
        path = /mnt/md0
        directory mode = 777
;        browseable = yes


lubuntuplex 01-14-2013 06:19 AM

SOLVED

For anyone else with this problem - the trick is to perform chmod -R 777 /mnt/md0 in terminal - this resets the permissions recursively (replace /mnt/md0 with your required directory).

This sets permissions to 'none' for owner, group, and other on folders created by the Lubuntu box.
The only thing to remember is that you have to create folders via the samba share and not directly in the directory ie. create folders in smb://localhost/mdnt/md0 and not just in /mnt/md0.

Hope that helps someone else!

rocq 01-14-2013 02:14 PM

I implemented kind of the same system differently. I added my user to the samba group. The samba shared folders have rwx permissions for the group and guid bit is set. The result: I have rwx access to the shared folder since (I'm in the samba group) and whenever I create a new folder the owner is me and the group is samba (since guid is set on the folder). Works fine...

So, in other words... Try fixing it with group sharing and using the guid bit. Don't be reckless with the file persmissions by giving rwx to 'other'.

EricTRA 01-14-2013 11:11 PM

Hi,

Sorry to come back this late but I'm glad to see that you got your problem solved.

Kind regards,

Eric


All times are GMT -5. The time now is 04:21 AM.