LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-22-2008, 01:11 PM   #1
Vanyel
Member
 
Registered: Jul 2007
Location: NY, NY
Distribution: RHEL, CentOS, MacOS X
Posts: 158

Rep: Reputation: 29
Cannot make SAMBA guest share r/w to world


Okay, this is driving me NUTS!!! I've been scouring the web all morning, looking through man pages, and it seems that everything should be right, but things aren't working.

My RHEL 4 machine has a SAMBA share designated for guest r/w access

Code:
[lab_share]
        path = /usr1/lab_share
        public = yes
        only guest = yes
        writable = yes
        browseable = yes
        create mask = 0666
        directory mask = 0777
;       read only = no
;       comment = None
;       guest account = nobody
;       guest ok = yes
;       valid users = None
;       invalid users = None
(you can see commented out, some parameters I have been playing with, in desperation)
A quick testparm seems to confirm things are okay.

Code:
[lab_share]
	path = /usr1/lab_share
	read only = No
	create mask = 0666
	directory mask = 0777
	guest only = Yes
WINDOWS machines mounting the share do indeed have full r/w access as guest. It's only other RHEL 4 machines mounting the share via smb that don't. The other linux boxes can only r, except for root

From an example linux box, you can see that
1. I can't make a file in the mounted share
2. only root has write permissions to the mounted share
3 In /etc/fstab I'm mounting the share without uname/pwd, and with rw explicitly defined, yet I still can't write to it. Disk permissions for the share on the server are rwxrwxrwx, btw.

Code:
[van@mako /lan_mnt]$ touch lab_share/file
touch: cannot touch `lab_share/file': Permission denied

[van@mako /lan_mnt]$ ls -al
total 32
drwxr-xr-x  10 root root    4096 Aug 12 16:01 .
drwxr-xr-x  30 root root    4096 Jul 14 12:11 ..
<snip>
drwxr-xr-x   1 root lab 4096 Aug 22 13:36 lab_share
<snip>

[van@mako /lan_mnt]$ more /etc/fstab | grep lab_share

//fluke/lab_share       /lan_mnt/lab_share      smbfs   rw,gid=lab        0 0
I am STUCK! Why can't my linux boxes r/w to the SAMBA share? Is it an smb.conf problem on the server? Or missing /etc/fstab option on the clients?
 
Old 08-23-2008, 07:13 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Linux file permissions take precedence over Samba settings.Check the Linux file settings for the shared directory and any parent directories.

Last edited by stress_junkie; 08-23-2008 at 07:15 AM.
 
Old 08-27-2008, 09:35 AM   #3
Vanyel
Member
 
Registered: Jul 2007
Location: NY, NY
Distribution: RHEL, CentOS, MacOS X
Posts: 158

Original Poster
Rep: Reputation: 29
Thanks, but the share was already rwxrwxrwx . It's parent was the root of the hard drive so I didn't want to change that. As a test, I made a new parent, /export, moved lab_share into it, edited the smb.conf file and made sure the new parent had the same permissions. Nope. No change. Other Linux boxes still mount lab_share as rwxr-xr-x .
 
Old 08-27-2008, 10:03 AM   #4
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 32
I have had similar problems to this before. For me, having root own samba shares is not really good.

Try changing the ownership of the shared directories and sub directories to a normal user (or create a user strictly for samba shares). As root:
Code:
chown -R  <newuser>:<group of newuser> <share directory>
From there, you should only need this in your smb.conf file:
Code:
[lab_share]
        path = /usr1/lab_share
        force user = <user you made owner of the share>
        guest ok = Yes
        read only = No
Then restart samba service and see if it worked.

Note: You may need to add some of your lines back to the smb.conf file to get exactly what you want. Play around with it.

Last edited by CRC123; 08-27-2008 at 10:05 AM.
 
Old 08-28-2008, 09:09 AM   #5
Vanyel
Member
 
Registered: Jul 2007
Location: NY, NY
Distribution: RHEL, CentOS, MacOS X
Posts: 158

Original Poster
Rep: Reputation: 29
Thanks, but no dice.

I chown'd the share to be a non-admin user I keep on all Linux boxes, but I find that the Force User = line does nothing. The share still mounts as root on the client. In /etc/fstab on the client I can user the uid= argument on the samba mount line to force the share to mount owned by that user, but that still does nothing for other users. The permissions on the client are still rwxr-xr-x .

I also found that the "rw" argument on the samba line in the client's fstab only changes status for the Owner - i.e. making the argument "ro" makes the share ro for the Owner, regardless of the rwx permissions seemingly in force, as seen by ls -al . Group and other permissons on the share remain r-xr-x, no matter what.


(time passes)


I GOT IT! I kept on playing with it and the answer was (or seems to be) ...

In fstab on the client, I thought the correct mounting syntax was

Code:
//fluke/lab_share       /lan_mnt/lab_share      smbfs    rw     0 0
But it's not! This mounted, but with my problems. The correct way (under RHEL 4 at least) is

Code:
//fluke/lab_share       /lan_mnt/lab_share      cifs    rw     0 0
Just changing "smbfs" to "cifs" enabled rwxrwxrwx for everyone.

Note: I also discovered that this only works on my machines with kernals 2.6.9-55 or above. I'm not sure when this was fixed, but on my machines with older kernals (2.6.9-5 is one example), cifs gives an error and they can only mount the share with smbfs, read-only for all but owner.
 
Old 08-28-2008, 09:25 AM   #6
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 32
Quote:
Originally Posted by Vanyel View Post
Just changing "smbfs" to "cifs" enabled rwxrwxrwx for everyone.

Note: I also discovered that this only works on my machines with kernals 2.6.9-55 or above. I'm not sure when this was fixed, but on my machines with older kernals (2.6.9-5 is one example), cifs gives an error and they can only mount the share with smbfs, read-only for all but owner.
Good to know! lol. I just checked my fstab and apparently I have my share mounted as 'cifs' also! lol.
 
  


Reply

Tags
samba, sharing



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 guest share with valid user carlmarshall Linux - Server 7 08-07-2008 05:17 AM
mount samba share as guest user twac Linux - Software 3 06-05-2007 01:55 PM
Cannot write to samba share with XP guest under VMware Workstation 6 (Feisty host) galileux Linux - Software 2 05-17-2007 04:22 PM
No real guest access to samba share possible cumbersome Linux - Software 1 06-23-2006 03:49 PM
Samba to share between host and guest in VMware cncrazu Linux - Software 0 06-11-2004 10:02 AM

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

All times are GMT -5. The time now is 06:01 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