LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Samba - cannot make writeable shares (https://www.linuxquestions.org/questions/linux-server-73/samba-cannot-make-writeable-shares-571902/)

tpn 07-24-2007 10:39 AM

Samba - cannot make writeable shares
 
Hi guys,

I'm configuring a new samba server (samba-3.0.25b-2.fc7) on a FC7 box.

What happens is that I login to the server with user samba, I can enter and read from shares, but cannot write in any share that I (try to) make writeable.

First I configured the shares manually from examples, then I tried with the GUI (system-config-samba-1.2), when all failed I tried to make writeable shares with SWAT but still no luck.

the smb.conf is:
Code:

[global]
        netbios name = ##
        server string = #######
        passdb backend = tdbsam
        log file = /var/log/samba/log.%m
        max log size = 50

[tst1]
        comment = teeeest
        path = /tst1
        username = samba
        valid users = samba
        admin users = samba
        read list = samba
        write list = samba
        read only = No

[tst2]
        comment = zzZZ
        path = /tst1
        readonly = No
        writeable = Yes

the file permissions are:
Code:

[root@## tst1]# pwd
/tst1
[root@## tst1]# ls -al
total 32
drwxrwxrwx  2 root root 4096 2007-07-24 16:57 .
drwxr-xr-x 27 root root 4096 2007-07-24 16:56 ..
-rwxrwxrwx  1 root root  19 2007-07-24 17:58 dsa
-rwxrwxrwx  1 root root  37 2007-07-24 18:34 dsaa
-rwxrwxrwx  1 root root  37 2007-07-24 18:34 dsaaa

It's not a permission problem since the files/folders have 777, not a firewall problem (allowed all traffic to/from my host).

And there are no errors in the log files.

Anyone could help me out with this please? :)

zQUEz 07-24-2007 06:45 PM

I am still relatively new to Samba myself, however, I am wondering if your entry: "read list" is causing issues. Blurb from "man smb.conf" says:
########## start ###########
read list (S)
This is a list of users that are given read-only access to a service. If the connecting user
is in this list then they will not be given write access, no matter what the read only option
is set to. The list can include group names using the syntax described in the invalid users
parameter.

Default: read list =

Example: read list = mary, @students

########## end ##############

I read that as saying that even though you have "samba" user set to writable that the fact he is also listed in "read list" means they wont get write access.

I know I didn't use that value at all when I set up my, working, test boxes.

jschiwal 07-24-2007 07:11 PM

Is the samba user a system user. If so, don't login as that user, and create a new user and group instead.

Generally, the directory you are sharing will be owned by the user and group owner that matches the smb.conf values. Also set the sticky bit on the directory itself if more than one user has write permissions.

I can't tell if you are trying to create an anonymous share (which usually uses the guest user) or if you happened to give yourself the username of samba.

Look for the "Samba 3 by Example" book supplied either by your samba or samba-doc package. You may be trying to implement a share similar to their no-frills server examples in chapter 1.

That said, I did create a /home/samba directory on my laptop, and created this share:
Code:

[samba]
        path = /home/samba
        read only = No
        guest ok = Yes
        available = Yes

I restarted the samba services and was able to create a file on the share from another computer. The /home/samba directory is owned by root, so I didn't follow the Samba 3 by Example sample config in chapter 2. But the share is named samba which I think you wanted, and is owned by root which s the same as your example.

After making a change, I used ssh to connect to another host (delllap) where I ran konqueror to test the new samba share. I was to lazy to walk over to the other computer! This technique allows you to experiment with different smb.conf configurations.

tpn 07-25-2007 03:18 AM

zQUEz:

I tried removing that, same thing, no luck.


jschiwal:

The samba user is a system user, I've added it to the smbusers and created a password with smbpasswd, the server accepts this login when I view a share.

I'm not trying to create anonymous acces, I just named the test user samba.

Also I tried your share configuration and still no change. (btw, yes, I restarted the service)


One thing I forgot to mention, if I try to delete a file, it won't give an error message, but the file will be there when I refresh. On the other hand when I put readonly = Yes it gives me an error when trying to delete. So this makes me think that samba creates the share writeable, but something goes wrong somewhere else.

I'll try the book also, but since it accepts the delete, I don't think the smb.conf is the problem.

jschiwal 07-25-2007 05:08 AM

I still don't get the purpose of the samba share or what you are trying to accomplish. Who uses the share? How many users will use this server? I noticed that you are using tdbsam as a backend database instead of smbpasswd. But you seem to be using /etc/passwd and /etc/shadow for authentication of the samba user. Usually, tdbsam is used when you have at least 50 users and don't want to have to replicate the users & passwords among the different hosts. It doesn't seem that you have set up anything like that so maybe you want to use smbpasswd instead.

tpn 07-25-2007 06:17 AM

I'm just trying to make a few writeable shares. The server will be used by 20 users maximum. I'll make a samba user for each person using it but for now I just use the samba username for testing.

The tdbsam I just picked up with a sample config on the samba website if I remember right :).

I'll switch back to smbpasswd, but the users work right, the writeable share doesn't.

mokele 07-25-2007 07:58 AM

Are your clients all on windows? If so it would be a good idea
to set `security = user' on [GLOBAL] That is, if you want them
to have an smb password set on server. You can also set it to
share and they won't be asked for login

Take a look at the following smb.conf and compare with yours.

[global]
workgroup = workgroup
netbios name = file-server
server string = Linux Samba Server
encrypt passwords = yes
security = share
local master = no
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

[homes]
read only = yes
browseable = no
writable = no

[win]
comment = All windows data sotrage
path = /home/west/win
public = yes
read only = no
browseble = yes
writable = yes
write list = west
create mask = 755

See if you are missing something. This configuration works
well for windows clients on my LAN.

If you have any linux clients please post the way you are mounting.

-W

tpn 07-25-2007 09:17 AM

All the clients are Windows XP.

I've tried your conf, no change.

I need security = user but I've tried share and I still can't write.
(from what I've read, default is user, I've also added it specifically and no change)

Dunno what else to do to it, nothing works :scratch:

mokele 07-25-2007 05:36 PM

Can you please post your `fstab' configuration on the samba server?

-W

tpn 07-26-2007 03:10 AM

Code:

[root@## /]# cat /etc/fstab
LABEL=/                /                      ext3    defaults        1 1

The shares are in /samba, on the same partition.

blackfish 07-26-2007 03:47 AM

try running the chown and chmod commands on the folders that are shared on the same server?

does that change anything at all?

tpn 07-26-2007 04:17 AM

No.

Already tried chmod 777, 1777, 775 with owner samba and others.

mokele 07-26-2007 11:13 AM

All right, if I understand what you posted you are sharing
your root.

Anyways. This is what you'll need.
Code:

|User      |To access and write to:        |Must have                  |
|-----------|--------------------------------|----------------------------|
|Windows    |Its own home directory          |/home/jondoe/sharepoint    |
|User      |on samba server                |with at lease              |
|Login:    |ie. /home/jondoe/              |u+rw- permision.  Or better |
|          |                                |yet u+rwx                  |
|U: jondoe  |Needs login:                    |                            |
|P: alive  |U: jondoe                      |smbpasswd identical to      |
|          |P: alive                        |windows login              |
|          |                                |ie. U: jondoe              |
|          |                                |    P: alive                |
|-----------|--------------------------------|----------------------------|
|          |                                |                            |
|Windows    |Common home directory on        |/home/admin/shares/userdocs |
|User      |samba server, used for          |with at lease:              |
|Login:    |multiple sharepoint            |uo+rw- permision.  Or better|
|          |                                |yet uo+rwx                  |
|U: jondoe  |ie. /home/admin/shares/        |                            |
|P: alive  |                                |smbpasswd: not necessary    |
|          |    Login:                    |                            |
|          |                                |                            |
|          |    U: admin                  |                            |
|          |    P: alluse                  |                            |

Important note* If you are mounting existing directories you'll have
to chmod -R accordingly. eg. chmod -R uo+rw /home/admin/shares/userdocs

There is another configuration using groups, just use the
first configuration using: ug+rwx and users can access and
write to each other home shares as long as they are in the
same group in the samba server. Also note that each user
needs to have the exact same username and password for
samba credentials - smbpasswd.

The second configuration is not safe, but its the best I
can do for windows logins that has spaces in the username
and don't want to change it. You can always suggest an
alias or migrate the user to a one word username, its the
users choice if (s)he is the boss.

Let me know if this information helps.

-W

tpn 07-27-2007 04:31 AM

No, I want to share some folders so that users will be able to store shared data in them.

It is not a permission problem, I already tried all combinations at least 5 times :)

Dunno what I'm gonna do with it.

mokele 07-27-2007 07:46 AM

tpn

I gave you the most common scenarios, so you could adapt from those.

But so far you haven't tell us what you have done, haven't posted
any error messages, and the little configuration you have shown seems
very obscure for me, or anyone here to figure out your problem. We
don't know if you want to share a single folder to everyone or you
want to create individuals. Its very hard for that second scenario
in the table to fail.

While I was writing it, I did:

-Create a test user on Win XP.
-Create a shared folder on an existing user on samba server
---chmod'ed it to uo+rwx
-Added the share folder to smb.conf
-restarted samba
********
*Note, smbpasswd for the test user isn't even necessary in
this configuration.

**Note, this configuration is not safe

And I could read/write right away.

More information please.

-W

tpn 07-27-2007 10:09 AM

I don't have any clue why it didn't work, but, as a last resort I've done a yum remove samba, got the sources from samba.org, recompiled it all, tweaked the init script from the rpm, paths, files, and now it works just fine with the same folders, permissions, owners, shares, conf, smbusers, smbpasswd.


All times are GMT -5. The time now is 11:17 PM.