samba problem

Hi,

I have a samba share like in belows smb.conf mounted like


//192.168.0.2/media  /mnt/media           cifs       _netdev,users,auto,user=reg%107467    0 0

in fstab and when i create (or copy) a directory it gets permissions “drwxr-xr-x” - why don’t its permissions get set to “0777”? Isn’t that weird? What am I( missing? :eek:

my /etc/samba/smb.conf


[global]
workgroup = TUX-NET
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes
add machine script = /usr/sbin/useradd *-c
Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
security = user

[media]
    comment = Media Share
    path = /mnt/SafeFiles/media
    browseable = yes
    writeable = yes
    guest ok = yes
    create mask = 0777
    directory mask = 0777
    force create mode = 0777

...more shares...
...
...

Thanks for hints and suggestions
Ron:confused:

The Linux permissions on directory “media” are a constraint too. You convolve the permissions from smb.conf with those from the Linux side of things, and you end up with the more restrictive of the two sets. So try changing the directory “media” to the least restrictive, viz drwxrwxrwx, so it doesn’t interfere with what you want to set via smb.conf.

I believe you’re actually talking about /mnt and not /media, cause /mnt is where the things get mounted.
So anyways I ran a chmod -R 777 /mnt and when i create a direcoty in the media share, i stil end up with this:
drwxr-xr-x 2 nobody nobody 0 2008-08-09 07:26 AA
how can i make this being drwxrwxrwx automatically on creation?:confused:
Thanks!
Ron

There’s inconsistency between this statement of yours:

//192.168.0.2/media /mnt/media cifs …etc etc

and this statement:

… cause /mnt is where the things get mounted

The first statement says the mount is in directory “media” located at /mnt/media on the client. The second says it’s in directory “mnt” located at /mnt on the client.
So let me get this straight in my head. Is this right:

  1. you have a Suse server at 192.168.0.2
  2. server has a Linux user called “reg”
  3. you have enrolled reg in the Samba user database on the server with a Samba password “107467”
  4. the server shares the directory “media” located at /mnt/SafeFiles/media
  5. you have a Suse client that can see the share over the network when viewed from the network browser of the client (e.g. Nautilus or Konqueror) and it sees the share by network name “media”
  6. you want to make a network drive to mount in the client so that when you look in directory /mnt on the client you see the media files shared from the server.

Is that right? If it is then your current setup won’t work because of the contradiction. So please tell me which of these statements are wrong and which are right.

What do you mean by “Samba user database”?
the password is just the user’s password - do I need a special samba password? :o

Uhm, I want to mount the shared content on “/mnt/media”

What do I need to change on my setup? I’m on my client system “reg” as well by the way - but that shouldn’t influence it - would it? :o

OK there are many ways to make the share. Here’s two

Here’s the form if you want a particular user on the client, for example frednurk, to read/write to the share:
Note frednurk can be reg but doesn’t have to be reg.
Make this changes in smb.conf:

[media]
    comment = Media Share
    path = /mnt/SafeFiles/media
    read only = no
    force user = reg

Make the directory “media” at /mnt/SafeFiles/media and all the files to be owned by reg. The “force” parameter will cause anything done by any user e.g. frednurk, in any client thereafter to be done in the name of reg. So directory media doesn’t have to be any special permissions, drwxr-xr-x defaults will do.

Add reg to the Samba user database on the server, with the password 107467. Only Samba passwords are recognised when transmitted over a cifs mount. To add user reg, open a console and enter this:

sudo smbpasswd -a reg

and answer the password question. Only need do that on the server.

Make the line in fstab to be like this if you want only a particular user (e.g. frednurk) to access it from the client:

//192.168.0.2/media  /mnt/media cifs user=reg%107467,_netdev,uid=frednurk,gid=users 0 0

======================================================================
Here’s the form if you want every user who might log onto the client to read/write to the share:

Make the same share in smb.conf. Make the same ownership of the directory /etc etc /media except make it drwxrwxrwx.

Add reg to the Samba user database on the server, with the password 107467, as before.

Make the line in fstab to be like this if you want every login user to read/write, note uid is now reg:

//192.168.0.2/media  /mnt/media cifs user=reg%107467,_netdev,uid=reg,gid=users 0 0

======================================================================
Luck
Swerdna

This has worked out quiet well, thank you for your help!
But one little thing. When executing “mount -a” from the command line it’s still asking me for a password, why is that? (no user or password specified in fstab)

When executing “mount -a” from the command line it’s still asking me for a password, why is that? (no user or password specified in fstab)

You have to add the password 107467, under the name reg to the Samba user database on the computer 192.168.0.2. And make the server’s shared directory owned by reg. Then specify user=reg%107467 in the cifs options in fstab on the client. Maybe you got a typo in the password or username you added to Samba database on the server – add it again.