LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 01-02-2006, 04:12 PM   #1
Snump
Member
 
Registered: Sep 2004
Location: Pennsylvania, USA
Distribution: Trying to decide
Posts: 229

Rep: Reputation: 30
Samba is going to kill me


Using Mandriva 2006, I just can't get Samba to work. Can somebody post the normal default smb.conf file? I've been screwing around with mine for a week and nothing works. I think I better start from scratch.

Also, what entry to I need in smb.conf for a share that can be written to, and read from on a Windows machine? I move rather large files back and forth and its alot easier with samba. I don't want to use ftp.
I just need a general use all crap directory to dump stuff to and from.
 
Old 01-02-2006, 06:35 PM   #2
Franklin
Senior Member
 
Registered: Oct 2002
Distribution: Slackware
Posts: 1,348

Rep: Reputation: 217Reputation: 217Reputation: 217
Here's mine:
Code:
# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SuSE
# Date: 2005-01-28
[global]
	workgroup = #####
	server string = Samba Server
	hosts allow = 192.168.1. 127.
	os level = 99
	time server = no
	unix extensions = Yes
	encrypt passwords = Yes
	map to guest = Bad User
#	printing = CUPS
#	printcap name = CUPS
	socket options = SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY
	wins support = yes
	veto files = /*.eml/*.nws/riched20.dll/*.{*}/
	log file = /var/log/samba.%m
	max log size = 50
	security = user
	domain master = yes
	preferred master = yes
[data]
	comment = Server Files
	path = /data
	browseable = yes
	read only = No
	create mask = 0640
	directory mask = 0750
I used to use SuSE 8.2 for my server, but I now use slackware. I just pasted the file into the /etc/samba directory - worked fine. That's why SuSE is mentioned in the comments. Very basic. Printing is commented because I have no printer attached to the server.
 
Old 01-02-2006, 07:06 PM   #3
Snump
Member
 
Registered: Sep 2004
Location: Pennsylvania, USA
Distribution: Trying to decide
Posts: 229

Original Poster
Rep: Reputation: 30
Here is my smb.conf file...
Under the windows machine I just get propted for a usernamt and password. I enter in my linuc account and linuc password - nothing. I don't get in.
Here is what happens when I try to execute the smbpasswd command as root:

[root@Prometheus samba]# smbpasswd justin
New SMB password:
Retype new SMB password:
Failed to find entry for user justin.
Failed to modify password entry for user justin



Code:
[global]
workgroup = SHAKESPEARE
server string = My Lil Linux Box
log file = /var/log/samba/%m.log
security = user
# encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

[Downloads]
comment = Downloads
path = /home/samba
browseable = yes
writable = yes
public = yes
read only = no

# [homes]
# comment = My Home Directory
# browseable = yes
# writable = yes
# public = yes
# read only = no

[printers]
path = /var/spool/samba
public = yes
guest ok = yes
printable = yes
browseable = yes
writable = yes
read only = no
 
Old 01-02-2006, 07:15 PM   #4
Franklin
Senior Member
 
Registered: Oct 2002
Distribution: Slackware
Posts: 1,348

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Here is what happens when I try to execute the smbpasswd command as root:

[root@Prometheus samba]# smbpasswd justin
New SMB password:
Retype new SMB password:
Failed to find entry for user justin.
Failed to modify password entry for user justin
Type this as root instead:

# smbpasswd -a justin

That should help.
 
Old 01-02-2006, 07:39 PM   #5
Franklin
Senior Member
 
Registered: Oct 2002
Distribution: Slackware
Posts: 1,348

Rep: Reputation: 217Reputation: 217Reputation: 217
This is an oldie-but-goodie:

http://www-128.ibm.com/developerwork.../l-samba2.html
 
Old 01-02-2006, 08:32 PM   #6
Snump
Member
 
Registered: Sep 2004
Location: Pennsylvania, USA
Distribution: Trying to decide
Posts: 229

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Franklin
Type this as root instead:

# smbpasswd -a justin

That should help.

AH ha! I did a chmod 777 on that directory and I can copy to it.

What would you suggest I set it to? I obviously don't want full re and execute permossions on that folder.

Last edited by Snump; 01-02-2006 at 08:55 PM.
 
Old 01-02-2006, 11:22 PM   #7
Snump
Member
 
Registered: Sep 2004
Location: Pennsylvania, USA
Distribution: Trying to decide
Posts: 229

Original Poster
Rep: Reputation: 30
OK, I'm back to square one. Everytime I do a chmod 777 on the directory, it works fine for a while. Then after a few minutes, I get this on the Windows end.

http://img252.imageshack.us/img252/8087/error8ui.png
 
Old 01-03-2006, 04:11 PM   #8
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Try adding
Code:
valid users = justin,maybesomeotheruser
to the stanza for [Downloads]

What is the ownership on that /home/samba directory? Make sure justin is in the group that owns it. Mandriva's security program automatically removes world-writable permissions from things in /home. You can disable this in the Mandrake Control Centre but its easier to set things up properly by changing the group ownership.
 
Old 01-04-2006, 08:31 AM   #9
Snump
Member
 
Registered: Sep 2004
Location: Pennsylvania, USA
Distribution: Trying to decide
Posts: 229

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by tkedwards
Try adding
Code:
valid users = justin,maybesomeotheruser
to the stanza for [Downloads]

What is the ownership on that /home/samba directory? Make sure justin is in the group that owns it. Mandriva's security program automatically removes world-writable permissions from things in /home. You can disable this in the Mandrake Control Centre but its easier to set things up properly by changing the group ownership.
Here's the ownership information
total 32
drwx--x--x 39 justin justin 4096 Jan 4 09:26 justin/
drwx--x--x 2 root root 16384 Dec 22 17:43 lost+found/
drwx--x--x 3 mike mike 4096 Dec 22 20:00 mike/
drwx--x--x 2 nobody root 4096 Jan 2 16:45 public/
drwx--x--x 2 nobody root 4096 Jan 2 21:57 samba/


I'm hoping to make this a general share so all users can access it.
Maybe it would be easier to get it out of the home directory and stick it somewhere else? If thats a good idea, where do you think I should put it? I need alot of space as files can hit a gig. etc?
 
Old 01-04-2006, 05:00 PM   #10
thorn168
Member
 
Registered: Oct 2004
Location: USA
Distribution: Vector Linux 5.1 Std., Vector Linux 5.8 Std., Win2k, XP, OS X (10.4 & 10.5)
Posts: 344

Rep: Reputation: 42
Are you using the latest release of Samba 3.0.21a? If not try updating the Samba server to see if that helps.
 
Old 01-04-2006, 05:43 PM   #11
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
Are you using the latest release of Samba 3.0.21a? If not try updating the Samba server to see if that helps.
Probably more trouble than its worth since updating samba is only going to help if there's a new feature in a later version that you need (Mandriva backports all the bug-fixes).

Quote:
Snump: drwx--x--x 2 nobody root 4096 Jan 2 21:57 samba/
These permissions look like the problem, not your samba setup. Since the Mandriva security checks will remove world writable permission from directories in /home the cleanest solution is probably to create a group (call it whatever you want) and put all the users in it that you want to be able to access that directory (see Mandrake Control Centre->System->Add Users.. to create your group and add users to it).

Now make the directory owned by that group
Code:
chown -R :groupname /home/samba
and also setgid on it so that files and folders created in future will have the same group ownership
Code:
find /home/samba -type d -exec chmod g+s {} \;
(this command sets it on any existing subfolders too)

Finally add the group name prefixed with '@' to the valid users line in the stanza for that share in smb.conf
Code:
valid users=@groupname
The other way would be to turn off the automatic fixing of home dir permissions in the Mandrake Control Centre->Security->Set Security Level...->Periodic Checks and disable 'Check Permissions of Files in User's Home' and 'Check files/directories writable by everybody'. But this is a bad, hacky, security-compromising solution so try the group ownership thing first
 
Old 01-04-2006, 09:20 PM   #12
Snump
Member
 
Registered: Sep 2004
Location: Pennsylvania, USA
Distribution: Trying to decide
Posts: 229

Original Poster
Rep: Reputation: 30
Ok... I created a group called samba, and added everyone to it. I changed the ownership of home/samba to the new samba group.
Code:
drwx--s--x   2 nobody samba   4096 Jan  2 21:57 samba/
Here's my smb.conf entry:
Code:
[Downloads]
comment = Downloads
path = /home/samba
browseable = yes
writable = yes
public = yes
read only = no
valid users=@samba
Restarted the process;
Same thing. Access denied from the Windows end.
 
Old 01-04-2006, 09:20 PM   #13
Snump
Member
 
Registered: Sep 2004
Location: Pennsylvania, USA
Distribution: Trying to decide
Posts: 229

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by thorn168
Are you using the latest release of Samba 3.0.21a? If not try updating the Samba server to see if that helps.

I had it working under the last version of Mandrake so I don't see how thats the problem.
 
Old 01-04-2006, 09:24 PM   #14
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
You still need to give the samba group read and write access on that directory (and the files and folders under it):
Code:
chmod -R g+rw /home/samba
 
Old 01-04-2006, 11:05 PM   #15
Snump
Member
 
Registered: Sep 2004
Location: Pennsylvania, USA
Distribution: Trying to decide
Posts: 229

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by tkedwards
You still need to give the samba group read and write access on that directory (and the files and folders under it):
Code:
chmod -R g+rw /home/samba

we're getting close.
It worked for a few minutes, but now I can't access that directory from the Mandriva machine. It says I don't have permission.

Let me ask you this, is it possible to have a home directory shared? If so, would each person's homedir be shared all the time, or just when they log into X?
 
  


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
What if 'kill -9' fails to kill a task? chii-chan Linux - Newbie 15 03-27-2013 03:47 PM
how to use kill to kill a batch of processes with same name? dr_zayus69 Linux - Software 2 09-03-2005 06:35 PM
Kill command could not kill Kanaflloric Linux - General 11 08-22-2005 07:18 AM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM
kill X = kill computer! jd243 Slackware 3 07-01-2003 11:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

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