LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-26-2006, 06:49 PM   #1
calande
Member
 
Registered: Oct 2005
Distribution: Ubuntu
Posts: 165

Rep: Reputation: 15
Can't write on samba shares


I have a FreeBSD server in the office that is used as a web server and file server. It shares a few directories with the rest of the computers in the office, which are WinXP and CentOS computers.

On the WinXP computers, I can access the samba shares that are located on the FreeBSD server just fine, I can read and write, no problem.

Now, on my CentOS computer, access to these samba shares is a little odd to the least:
- I can access samba shares only mounting them, and they don't appear when I click in Gnome on "Applications > Network Servers", which is a blank window. The samba shares show up on the WinXP computers just fine.
- It takes around 30 secs to mount the share (way too much)

- After mounting the samba shares, they show up under /mnt as expected, now:
* I can create a file or a directory in /mnt/www but I can't remove them
* I can create a file or a directory in /mnt/www but I can't create others under /mnt/www/whatever
* If I open an existing file in /mnt/www, I can read it but can't save it
* If I open an existing file in /mnt/www/whatever, it is blank

There is no need to type a password to access the shares. Here's what I use to mount the samba shares:

Code:
mount -t smbfs -o ip=192.168.0.2,uid=500,defaults,password='' //servidor/www /mnt/www
I have tried to solve this problem in vain, do you have an idea?
Thanks,
 
Old 07-26-2006, 07:50 PM   #2
PB0711
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: Ubuntu 10.10, ubuntu 11.04, suse 9.2, OSX
Posts: 259

Rep: Reputation: 30
So I always include the read write command with it just incase.

Code:
mount -t smbfs //windows/share /mnt/point -o rw,username=me,password=god
Remember that if you use gid and uid that the id's have to be the same as the user/group that you want. I've made this mistake so many times, I thought it's worth saying. Also check that the windows box gives write access on that drive.

If your useing KDE try Konquoer to read and write to the samba drive. ie
Code:
smb://windows_name
 
Old 07-26-2006, 08:38 PM   #3
calande
Member
 
Registered: Oct 2005
Distribution: Ubuntu
Posts: 165

Original Poster
Rep: Reputation: 15
Ok, I'm using all possible options, and the problem persists

Code:
rw,password='',ip=192.168.0.2,rw,users,uid=500,gid=500
If I launch gedit as root, I have all rights over these samba shares. But not as a regular user. What else do you suggest?
Thanks.

Last edited by calande; 07-26-2006 at 08:41 PM.
 
Old 07-26-2006, 09:54 PM   #4
scott2004
Member
 
Registered: Nov 2004
Location: Toronto, Canada
Distribution: Debian, OpenBSD, SuSE, Ubuntu
Posts: 68

Rep: Reputation: 15
Hi there,
Perhaps posting the share sections of your smb.conf would help. Do you have any odd ACLs in there (Create Mask, etc.)?

Also, what are the Unix permissions on the directory in question on your samba server?

Relatedly, is it possible that the user authenticating against the Samba server does not have permissions as a Unix user on the Samba machine (each user must be registered in both the samba password backend and the Unix one, unless your share is a guest only one). I've made this mistake before and forgotten to add the Unix account.

Finally, if none of the above helps, you might do a capture using Ethereal during a mount and access to see what your smb.mount daemon is saying to the Samba server and vice versa.

Scott
 
Old 07-27-2006, 11:44 AM   #5
calande
Member
 
Registered: Oct 2005
Distribution: Ubuntu
Posts: 165

Original Poster
Rep: Reputation: 15
Thank you Scott. Here's the shares list:

Code:
[WWW]
comment = Development
read only = no
path = /usr/local/servidor/www/
guest account = www
guest ok = yes
force create mode = 774
force directory mode = 774

[Documentos]
comment = Pasta geral do escritorio
read only = no
path = /usr/local/servidor/documentos
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774

[Design]
comment = Pasta de Arquivos Design
read only = no
path = /usr/local/servidor/design
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774

[Documentos Internos]
comment = Documentos Internos
read only = no
path = /usr/local/servidor/interno
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774
hosts allow = 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4
hosts deny = 0.0.0.0/0

[TMP]
comment = Arquivos Temporários
read only = no
path = /usr/local/servidor/tmp
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774
So, according to you, I need to add remote Unix users somewhere in the configuration of Samba on my file server? Do you know a tutorial that would explain this to me please?
Thanks,
 
Old 07-27-2006, 12:41 PM   #6
scott2004
Member
 
Registered: Nov 2004
Location: Toronto, Canada
Distribution: Debian, OpenBSD, SuSE, Ubuntu
Posts: 68

Rep: Reputation: 15
Hi Calande,
Some observations on your share definitions. Hopefully other list readers will correct me if I'm wrong.

As I noted, you need to have both a UNIX/Linux account for your users and Samba accounts, unless you want to allow password-less, public access. First some observations on your shares:

[WWW]
comment = Development
read only = no
path = /usr/local/servidor/www/
guest account = www
guest ok = yes
force create mode = 774
force directory mode = 774

In the case of your WWW share, you need a Unix/Linux account for the guest user "www". Does this account exist and does it have read/write permissions on /usr/local/servidor/www? ls -l /usr/local/servidor/www will tell you the perms on that directory's files. Also check perms on the dir itself (ls -ld). The linux user www must have read-write perms b/c samba will use the credentials of www to access /usr/local/servidor/www. The linux kernel will then allow or deny Samba's attempts based on those credentials (Samba only has the same privileges as the user accessing the Samba share).


[Documentos]
comment = Pasta geral do escritorio
read only = no
path = /usr/local/servidor/documentos
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774

In the case of your Documentos share, the user "nobody" may be the problem. nobody, if I'm not mistaken, is a pretty restricted user on Linux systems, so it's doubtful whether nobody would have permission to access /usr/local/servidor/documentos.

One way to test this is to su to nobody or su to www and try performing operations at the command line within those directories.

It could be that access from your WinXP machines is problem-free because they are bypassing the guest account. If your Windows XP account is "Calande" and calande has a linux account, then Samba allows access to these shares as user calande, not as user "nobody" or user "www". However, the mount command is usually only executed as Root so when you mount samba shared on you CentOS file system, you're authenticating to Samba as root. Samba may not allow root (esp. if root does not have a Samba account) in which case, Samba lets you connect using the guest account of "www" or "nobody" depending on the share.

The commands for managing users on Linux are useradd and usermod. The command for adding users to Samba is smbpasswd or pdbedit, both of which have man pages.

If you want to truly simplify things, you could just add "guest only = yes" (guest *only*, not guest OK) to each share definition which would allow/force everyone to connect without an account. You'd still have to make sure your guest accounts had permissions in Linux to access the directories/files, but at least then you'd be certain everyone using Samba (whether from CentOS or WinXP) was using only the prescribed guest accounts.

Scott
 
Old 07-27-2006, 12:55 PM   #7
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
add writable = yes to the shares.
 
  


Reply



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
Samba Shares... Write Error crazykiller Linux - Software 5 01-01-2006 03:35 PM
Unable to write to Samba Shares. usaf_sp Linux - Software 1 11-02-2005 01:45 PM
Windows ME cannot write to SAMBA shares apostate Linux - Software 2 07-30-2005 10:56 PM
Can not write to Samba Linux Shares from Windows boyd98 Linux - Software 2 05-12-2005 05:51 PM
Can only write to samba shares as root. Neuronet Linux - Software 17 06-27-2003 06:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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