LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-13-2013, 06:32 AM   #1
lubuntuplex
LQ Newbie
 
Registered: Jan 2013
Posts: 4

Rep: Reputation: Disabled
Question 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
 
Old 01-13-2013, 06:41 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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
 
Old 01-13-2013, 09:41 AM   #3
lubuntuplex
LQ Newbie
 
Registered: Jan 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
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.
 
Old 01-13-2013, 11:39 AM   #4
lubuntuplex
LQ Newbie
 
Registered: Jan 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Cool

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
 
Old 01-14-2013, 06:19 AM   #5
lubuntuplex
LQ Newbie
 
Registered: Jan 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
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!
 
Old 01-14-2013, 02:14 PM   #6
rocq
Member
 
Registered: Jan 2013
Location: Netherlands
Distribution: XUbuntu
Posts: 57

Rep: Reputation: Disabled
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'.

Last edited by rocq; 01-14-2013 at 02:17 PM.
 
Old 01-14-2013, 11:11 PM   #7
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

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

Kind regards,

Eric
 
  


Reply



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
Change File/folder Permissions in server ben60 Linux - Newbie 5 08-24-2011 09:10 AM
File permissions on an Ubuntu Server. algogeek Linux - Server 12 06-29-2009 03:11 AM
Windows file permissions with a Linux file server joseph_k Linux - Server 3 05-09-2008 12:54 PM
File server / Advanced Permissions lambmt Linux - Security 2 08-06-2004 08:49 AM
default file permissions for web server AZDAVE Linux - Security 3 11-13-2003 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration