LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Samba is going to kill me (https://www.linuxquestions.org/questions/mandriva-30/samba-is-going-to-kill-me-398750/)

Snump 01-02-2006 05:12 PM

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.

Franklin 01-02-2006 07:35 PM

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.

Snump 01-02-2006 08:06 PM

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


Franklin 01-02-2006 08:15 PM

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.

Franklin 01-02-2006 08:39 PM

This is an oldie-but-goodie:

http://www-128.ibm.com/developerwork.../l-samba2.html

Snump 01-02-2006 09:32 PM

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.

Snump 01-03-2006 12:22 AM

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

tkedwards 01-03-2006 05:11 PM

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.

Snump 01-04-2006 09:31 AM

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?

thorn168 01-04-2006 06:00 PM

Are you using the latest release of Samba 3.0.21a? If not try updating the Samba server to see if that helps.

tkedwards 01-04-2006 06:43 PM

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 :)

Snump 01-04-2006 10:20 PM

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.

Snump 01-04-2006 10:20 PM

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.

tkedwards 01-04-2006 10:24 PM

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

Snump 01-05-2006 12:05 AM

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?


All times are GMT -5. The time now is 01:30 PM.