Samba and File Permissions headache (Ubuntu)

  • Thread starter Thread starter JC
  • Start date Start date

JC

JC

Soldato
Joined
10 Dec 2003
Posts
5,774
Location
Surrey
I've been playing around with Ubuntu for over 6 months but always been the single user so I've never come across these file permission problems before!

This is what I'd like to achieve:

Computer 1 - acting as a desktop and file server - runs Ubuntu 9.04
User Accounts: A (Admin), B (User) and C (User)

2 Hard drives shared as Samba1 and Samba2

Computer 2 - A's Desktop - runs Ubuntu 8.04
User Accounts: A (Admin)

Computer 3 - C's Desktop - runs Ubuntu 9.04
User Accounts: C (Admin)

Computer 4 - a generic windows computer

I'd like all users A,B and C to have read and write access to all parts of the shares Samba1 and Samba2 from their respective computers on Ubuntu or Windows.
Similarly I'd like users A, B and C to be able to read the data on the local drives of computer 1 when they are logged in.

I'd ideally like to retain the password access.

Currently I have the samba shares working, although the network browser doesn't seem to find the shares often and I have to manually type the IP/host name. Any reason for that?

This is my samba config (edited to reflect the names used earlier)
Code:
[global]
    ; General server settings
    netbios name = Computer1
    server string =
    workgroup = HOME
    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend = tdbsam
    security = user
    null passwords = true
    username map = /etc/samba/smbusers
    name resolve order = hosts wins bcast

    wins support = yes

    printing = CUPS
    printcap name = CUPS

    syslog = 1
    syslog only = yes

    hosts allow = 127.0.0.1 192.168.1.0/24
    hosts deny = 0.0.0.0/0

[Samba1]
    path = /media/Data/Samba
    browseable = yes
    read only = no
    guest ok = no
    create mask = 0644
    directory mask = 0755
    force user = A
    force group = A

[Samba2]
    path = /media/Data2/Samba
    browseable = yes
    read only = no
    guest ok = no
    create mask = 0644
    directory mask = 0755
    force user = A
    force group = A

The problem is that to achieve the write access, the force user access for A is now blocking users B and C from reading the data locally unless they mount the Samba share.

What do I need to do to maintain the read and write access to the share without compromising the local read access to other users?

Thanks kindly for any assistance
 
Thanks for your post, I've followed some instructions that I eventually found on the web prior to seeing this.

I've changed
Code:
force group = A
to
Code:
force group = share

and created the new group share and placed all those users into it.

Running the commands below has sorted the existing directories and seems to permit local and samba directory access :D

Code:
sudo chgrp -R share /media/Data/Samba/Music
sudo chmod -R g+r+w+X /media/Data/Samba/Music

I've also changed the permissions from 0775 to 2775 and will see if this gives me the solution I'm looking for when creating files into the Samba share from remote access.
 
Back
Top Bottom