LinuxQuestions.org
Help answer threads with 0 replies.
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 11-28-2006, 07:11 PM   #1
osodani
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Rep: Reputation: 0
Samba driving me nuts


I have a new Fedora Core 5 installation. Samba (samba-3.0.21b-2) was installed during the initial install.

For the life of me, I cannot create a writable share, and it is driving me crazy. I would be grateful if anyone can spot the silly mistake I must be making.

I've simplified everything down to the following:

A directory /export/samba/test that is being shared
One file, test.txt inside the directory.

Here's the permissions on the directory:
Code:
[osodani@xxxx]~% ls -l /export/samba 
drwsrwsr-x 2 osodani ITStaff 4096 Nov 28 18:54 test
Here's the permissions on the file:
Code:
[osodani@xxxx]~% ls -l /export/samba/test/test.txt
-rwxrwxrwx 1 osodani ITStaff 3 Nov 28 18:54 /export/samba/test/test.txt
Here's my Samba config:
Code:
[global]
   workgroup = XXXX 
   encrypt passwords = yes
   smb passwd file = /etc/samba/smbpasswd
[mathshare]
   comment = Math Folder
   path = /export/samba/test
   public = yes
   writable = yes
   printable = no
   create mode = 0770
There is a user on the system called osodani. I set a smbpasswd for this user.

I can connect to the share with no problem, using the osodani user and smb password. I can read the files with no problem.
Code:
smb: \> ls
  .                   D        0  Tue Nov 28 18:54:10 2006
  ..                  D        0  Tue Nov 28 18:41:30 2006
  test.txt            A        3  Tue Nov 28 18:54:10 2006

                50600 blocks of size 8388608. 47647 blocks available
Attempting to rename the file via smbclient gives me this error:
Code:
smb: \> rename test.txt test1.txt
NT_STATUS_ACCESS_DENIED renaming files
Attempting to put a file gives me a similar error:
Code:
smb: \> put testme.txt
NT_STATUS_ACCESS_DENIED opening remote file \testme.txt
I can view the files from a Windows client, and open the test.txt file with no problem. Modifying the file or trying to create a new one in the share gives me an access denied error message.

Thanks for any insight you can give me! I know I'm missing something basic...
 
Old 11-28-2006, 07:50 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
The default for "read only" is yes, so you want to add a "read only = No" entry.
 
Old 11-28-2006, 08:04 PM   #3
osodani
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks - I tried it, and still no go. I get the same exact error messages when I try to write. I restarted the samba daemon, just to make sure.

New smb.conf:

Code:
[global]
   workgroup = LABSCHOOL 
   encrypt passwords = yes
   smb passwd file = /etc/samba/smbpasswd


[mathshare]
   comment = Math Folder
   path = /export/samba/test
   public = yes
   writable = yes
   printable = no
   create mode = 0770
   read only = no
Here's the relevant output of testparm:

Code:
[mathshare]
        comment = Math Folder
        path = /export/samba/test
        read only = No
        create mask = 0770
        guest ok = Yes

Last edited by osodani; 11-28-2006 at 08:05 PM.
 
Old 11-28-2006, 09:41 PM   #4
jscedunn
LQ Newbie
 
Registered: Nov 2006
Posts: 12

Rep: Reputation: 0
Did you add a samba user to that profile?
 
Old 11-28-2006, 10:51 PM   #5
osodani
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Do you mean with the valid users option? If so - yes. Same thing happens...
 
Old 11-29-2006, 03:12 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
What are the permissions for /export/samba/test? I think it should have write enabled for other as well with the sticky bit set.
 
Old 11-29-2006, 11:21 AM   #7
osodani
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Original Poster
Rep: Reputation: 0
I think I have it set correctly - see the first code block in my first post.

Again, I want to thank everyone for looking at this with me. I may try uninstalling the samba packages and starting from scratch.
 
Old 11-29-2006, 10:31 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Your test/ directory has the suid bit set rather than the sticky bit. You don't have the o+w bit set. I think that is why your users can't write files. I think you want to either use "chmod a=trwx test" or use the "force user = osidani" option. There is an example in the Samba 3 Reference manual for an anonymous read-write share. They use the "force user =" and "force group =" option. Setting the suid and guid on the directory will cause all files to be created with the same owner and group owner as the directory. See the example in the "Samba3-ByExample" document. It should be supplied by one of your available packages ( look in /usr/share/doc/packages/samba/ because it might already be there ) or you can download it at the www.samba.org website.

However you may want to change the permissions of the directory to "a=trwx" instead. Then you can control who has access to write to the server because they will need to be in the samba password database, such as added as a user and the password set with the smbpasswd program.

This is how the /tmp directory is setup. Any user can write to the /tmp directory. The sticky bit on the directory prevents one user from deleting another's files. Deleting a file is actually writing to the directory and not the file. This is why the sticky bit is needed needed for the directory. The permissions on the file itself will protect one user from overwriting a file belonging to another user.

Last edited by jschiwal; 11-29-2006 at 10:34 PM.
 
Old 12-10-2006, 04:52 PM   #9
osodani
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Original Poster
Rep: Reputation: 0
jschiwal - Thanks for your input on this.

I spent some time on the Samba listserv trying to get help, and they couldn't help me either.

Finally, I found this thread and this bug, which probably explains everything.
http://www.nabble.com/Problem-with-S...-t2712353.html
https://bugzilla.redhat.com/bugzilla....cgi?id=208253

The Fedora Core 5 versions of Samba and NIS just don't play well together. I'll be switching to Fedora Core 4 or CentOS.

Thanks again!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Help - it's driving me nuts! n4ogl Linux - Newbie 4 11-13-2005 10:28 PM
Driving me nuts!! jappstam12345 Linux - Newbie 7 03-11-2005 06:51 PM
This is driving me nuts! dareino Fedora 4 06-30-2004 03:17 AM
Setting Samba //computername !! Driving me Nuts! Amir Linux - Networking 2 02-27-2004 07:16 AM
driving me nuts!!! ihatebillgates Linux - Newbie 6 12-12-2003 08:03 AM

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

All times are GMT -5. The time now is 12:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration