LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-24-2007, 10:39 AM   #1
tpn
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Rep: Reputation: 0
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?

Last edited by tpn; 07-24-2007 at 10:42 AM.
 
Old 07-24-2007, 06:45 PM   #2
zQUEz
Member
 
Registered: Jun 2007
Distribution: Fedora, RHEL, Centos
Posts: 294

Rep: Reputation: 54
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.
 
Old 07-24-2007, 07:11 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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

Last edited by jschiwal; 07-24-2007 at 08:04 PM.
 
Old 07-25-2007, 03:18 AM   #4
tpn
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 07-25-2007, 05:08 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 07-25-2007, 06:17 AM   #6
tpn
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 07-25-2007, 07:58 AM   #7
mokele
Member
 
Registered: Jan 2005
Location: Puerto Rico
Distribution: Slackware 13
Posts: 146

Rep: Reputation: 15
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
 
Old 07-25-2007, 09:17 AM   #8
tpn
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Original Poster
Rep: Reputation: 0
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

Last edited by tpn; 07-25-2007 at 09:19 AM.
 
Old 07-25-2007, 05:36 PM   #9
mokele
Member
 
Registered: Jan 2005
Location: Puerto Rico
Distribution: Slackware 13
Posts: 146

Rep: Reputation: 15
Can you please post your `fstab' configuration on the samba server?

-W
 
Old 07-26-2007, 03:10 AM   #10
tpn
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Code:
[root@## /]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
The shares are in /samba, on the same partition.
 
Old 07-26-2007, 03:47 AM   #11
blackfish
Member
 
Registered: May 2006
Location: England
Distribution: CentOS, Ubuntu Server, Untangle, pfSense
Posts: 78

Rep: Reputation: 15
try running the chown and chmod commands on the folders that are shared on the same server?

does that change anything at all?
 
Old 07-26-2007, 04:17 AM   #12
tpn
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Original Poster
Rep: Reputation: 0
No.

Already tried chmod 777, 1777, 775 with owner samba and others.
 
Old 07-26-2007, 11:13 AM   #13
mokele
Member
 
Registered: Jan 2005
Location: Puerto Rico
Distribution: Slackware 13
Posts: 146

Rep: Reputation: 15
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

Last edited by mokele; 08-23-2007 at 07:01 AM.
 
Old 07-27-2007, 04:31 AM   #14
tpn
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 07-27-2007, 07:46 AM   #15
mokele
Member
 
Registered: Jan 2005
Location: Puerto Rico
Distribution: Slackware 13
Posts: 146

Rep: Reputation: 15
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

Last edited by mokele; 07-27-2007 at 07:48 AM.
 
  


Reply

Tags
samba, share, write



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
how do I make a HD writeable cole07 Linux - Software 5 06-14-2007 04:31 PM
anyone know to make samba shares writable? jasybee2000 Linux - Software 4 01-07-2005 08:25 AM
Samba 3.0.6 - How to mount Samba Shares from Windows 2003? kp1 Linux - Software 2 09-10-2004 06:03 PM
world writeable files will not stay world writeable antken Mandriva 1 03-02-2004 05:04 PM
Linux can mount samba shares but not windows shares bindsocket Linux - Software 1 12-01-2003 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:40 PM.

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