Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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.
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.
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.
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)
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.