Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Samba Directory Permissions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
al
Guru
Guru


Joined: 26 Dec 2002
Posts: 304
Location: Scotland

PostPosted: Sun Jan 02, 2005 2:32 pm    Post subject: Samba Directory Permissions Reply with quote

I have my Samba share setup on my server and it works fine for my WinXP computers.They can read+write to the share with no problem.

However when i try to write to the share from my Gentoo box(having mounted the share using LinNeighborhood)it takes a very long time then reports an error.
The files do get written to the share but the file permissions are all wrong.

For example the following file has these permissions on my Gentoo box:

Code:
ls -la a\)\ all\ i\ really\ want.mp3
-rwxr-xr-x  1 al users 4559348 Mar 27  1998 a) all i really want.mp3


And if i transfer it to the share it becomes:
Code:
 ls -la /home/samba/a\)\ all\ i\ really\ want.mp3
-rwxr--r--  1 nobody nobody 4559348 Mar 27  1998 /home/samba/a) all i really want.mp3


Do i need to "chmod" the samba directory to allow the correct file permissions to be allowed when transfering files in,Or do i need to mount the samba share with different file permissions?
I notice when i mount the shares with LinNeighborhood it has the following:
Code:
File Mode: 644  &  Dir Mode 755

Is this correct?

I think when i setup the share i did chmod 0777 on the samba directory,but it was a while ago so i could be wrong.

My smb.conf looks like this:
[global]
os level = 20
workgroup = samba
server string = Server
netbios name = Samba
map to guest = Bad User
log file = /var/log/samba3/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = Yes
dns proxy = No
security = share
invalid users = root
null passwords = yes

[public]
public = yes
browseable = yes
guest ok = yes
writeable = yes
create mode = 0766
path = /home/samba
allow hosts = 192.168.0.1/255.255.255.0

Can anyone help?
Thanks in advance.
:)
Back to top
View user's profile Send private message
gentoo_dude
l33t
l33t


Joined: 08 May 2004
Posts: 645
Location: Washington, DC

PostPosted: Sun Jan 02, 2005 3:05 pm    Post subject: Reply with quote

if the shared folder (disk or partition) is on the linux box then you don't have to mount it using linneighborhood. What i did was to edit my fstab and add it there, since my partition is ext3 fs. It mounts at boot time and i don't have any problems writing on it from windows or linux.
Back to top
View user's profile Send private message
barbar
Guru
Guru


Joined: 16 Apr 2003
Posts: 397
Location: Austria

PostPosted: Sun Jan 02, 2005 3:15 pm    Post subject: Reply with quote

I guess you want
Code:
 force create mode 0766
in your smb.conf.
You can check if
Code:
create mask
better suits your needs.
Back to top
View user's profile Send private message
al
Guru
Guru


Joined: 26 Dec 2002
Posts: 304
Location: Scotland

PostPosted: Sun Jan 02, 2005 3:50 pm    Post subject: Reply with quote

gentoo_dude:

The samba share is on a different computer.

barbar:

I tried force create mode 0766 and it does indeed set the file permissions but it still takes an age to write to the share resulting in an error:

Code:
cp: cannot create regular file `/home/al/mnt/SAMBA/public/01.Turn_The_Page.ogg': Input/output error


:?
Back to top
View user's profile Send private message
barbar
Guru
Guru


Joined: 16 Apr 2003
Posts: 397
Location: Austria

PostPosted: Sun Jan 02, 2005 4:04 pm    Post subject: Reply with quote

I nerver used LinNeighborhood but try to mount the share with cifs instead of smbfs.
Back to top
View user's profile Send private message
gentoo_dude
l33t
l33t


Joined: 08 May 2004
Posts: 645
Location: Washington, DC

PostPosted: Sun Jan 02, 2005 4:42 pm    Post subject: Reply with quote

Try adding at your [public] configuration the following option:
Code:
 read-only no
Back to top
View user's profile Send private message
al
Guru
Guru


Joined: 26 Dec 2002
Posts: 304
Location: Scotland

PostPosted: Sun Jan 02, 2005 5:07 pm    Post subject: Reply with quote

gentoo_dude wrote:
Try adding at your [public] configuration the following option:
Code:
 read-only no


Didnt help i'm afraid :(

Is this the correct permissions for the samba directory:

Code:
drwxrwxrwx  8 samba  users      4096 Jan  2 16:57 .


I need read+write+execute access for the user al:users (me on gentoo box) ,read+write+execute access for winxp users on my lan , no read+write+execute for anyone else outside my lan.

I would also like for the winxp users not be able to delete files they did not create

I'm trying to learn how to use the chmod command but its not easy.



:?
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Mon Jan 03, 2005 12:12 am    Post subject: Reply with quote

first of all you need to change your security to user
then you need to setup some samba users
then you need to disable guest access

Unless you do this you won't be able to give different users different permissions because the samba server sees them all as the same user.
Back to top
View user's profile Send private message
al
Guru
Guru


Joined: 26 Dec 2002
Posts: 304
Location: Scotland

PostPosted: Mon Jan 03, 2005 12:40 am    Post subject: Reply with quote

Thanks nobspangle

I will try that approach tomorrow,too late tonight-12:38AM

One thing i have noticed is that when i mount a samba share it actually changes the permissions of the local directory im mounting to.
I didn't know that could happen.

Anyway off to my bed 8O
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum