Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
samba/swat, can't get them to work properly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Carlino
Guru
Guru


Joined: 25 May 2005
Posts: 365
Location: Bordeaux, France

PostPosted: Thu Nov 29, 2007 7:51 pm    Post subject: samba/swat, can't get them to work properly Reply with quote

Hi all !
I've installed samba following this guide : http://www.gentoo.org/doc/en/quick-samba-howto.xml. Idem with swat, reading that guide:http://gentoo-wiki.com/HOWTO_Setup_Samba#GUI

The problem is:
Samba obviously works, but from the Gentoo box, none of the shared directories on the Win XP box are seen. From the Win XP box and the Debian one, shared directories on Gentoo are seen / accessible, but not writable. Browsing http://192.168.0.1:901/ in Firefox, to get to swat, leads to "connection failed".

The config / log files:

Code:
# smbclient -L localhost
Password:
Domain=[MYLAN] OS=[Unix] Server=[Samba 3.0.27a]

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Pilotes d'impression
        HPPhotosmart7260 Printer   HP Photosmart 7260 Network Printer
        public          Disk      Public Files
        myshare         Disk      Carlino's stuff
        IPC$            IPC       IPC Service (Samba Server 3.0.27a)
Domain=[MYLAN] OS=[Unix] Server=[Samba 3.0.27a]

        Server               Comment
        ---------            -------
        LITTLEINDIAN         Samba Server 3.0.27a
        ULYSSE               

        Workgroup            Master
        ---------            -------
        MYLAN                LITTLEINDIAN

Code:
# cat smb.conf
[global]
# Configuré à partir de http://www.gentoo.org/doc/fr/quick-samba-howto.xml
workgroup = Mylan
netbios name = littleindian

server string = Samba Server %v

printcap name = cups
printing = cups
load printers = yes

log file = /var/log/samba/log.%m
max log size = 50

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

interfaces = lo eth0
bind interfaces only = yes

hosts allow = 127.0.0.1 192.168.0.0/5
hosts deny = 0.0.0.0/0

security = share

guest account = carlino
guest ok = yes

#vfs object = vscan-clamav
#vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

[print$]
comment = Pilotes d'impression
path = /etc/samba/printer # Ce chemin contient la structure des pilotes
guest ok = yes
browseable = yes
read only = yes

write list = carlino,root

[HPPhotosmart7260]
comment = HP Photosmart 7260 Network Printer
printable = yes
path = /var/spool/samba
public = yes
guest ok = yes

printer admin = carlino,root

[printers]
comment = All Printers
browseable = no
printable = yes
writable = no
public = yes
guest ok = yes
path = /var/spool/samba

printer admin = carlino,root

[public]
comment = Public Files
browseable = yes
writable = yes
public = yes
create mode = 0766
guest ok = yes
path = /home/samba/public

[myshare]
comment = Carlino's stuff
path = /media/Images
valid users = carlino
public = no
#read only = yes
write list = carlino
#writable = yes
printable = no
create mask = 0765

Code:
# cat /var/log/samba/log.smbd
smbd version 3.0.27a started.
  Copyright Andrew Tridgell and the Samba Team 1992-2007
[2007/11/29 20:33:24, 1] param/loadparm.c:lp_do_parameter(3509)
  WARNING: The "printer admin" option is deprecated
[2007/11/29 20:33:24, 1] param/loadparm.c:lp_do_parameter(3509)
  WARNING: The "printer admin" option is deprecated
[2007/11/29 20:33:24, 0] printing/print_cups.c:cups_connect(69)
  Unable to connect to CUPS server SharedPrinter:631 - Succès
[2007/11/29 20:33:24, 0] printing/print_cups.c:cups_connect(69)
  Unable to connect to CUPS server SharedPrinter:631 - Succès
[2007/11/29 20:56:35, 0] printing/print_cups.c:cups_connect(69)
  Unable to connect to CUPS server SharedPrinter:631 - Aucun fichier ou répertoire de ce type
[2007/11/29 20:56:35, 0] printing/print_cups.c:cups_connect(69)
  Unable to connect to CUPS server SharedPrinter:631 - Aucun fichier ou répertoire de ce type

Code:
# ps aux | grep mbd
root      7648  0.0  0.4  12420  2796 ?        Ss   20:33   0:00 /usr/sbin/smbd -D
root      7655  0.0  0.1  12420  1120 ?        S    20:33   0:00 /usr/sbin/smbd -D
root      7658  0.0  0.2   7656  1312 ?        Ss   20:33   0:00 /usr/sbin/nmbd -D

I did had a samba user (carlino), which is a Gentoo user as well
Code:
# cat /etc/samba/smbusers
# Unix_name = SMB_name1 SMB_name2 ...
# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/files/config/smbusers,v 1.1 2007/09/07 21:07:40 dev-zero Exp $
root = administrator admin
nobody = guest pcguest smbguest
local_user = carlino

I mentioned swat in USE.
Code:
# cat /etc/xinetd.d/swat
# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/files/config/swat.xinetd,v 1.1 2007/09/07 21:07:40 dev-zero Exp $

service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
#       only_from       = localhost
        only_from       = 0.0.0.0
        user            = root
        server          = /usr/sbin/swat
        log_on_failure += USERID
        disable         = no
}

Any idea about what I missed in the whole configuration ?
_________________
Core 2 Quad 9400, Asus PQ5 Pro, Nvidia Geforce GTX 66O
Back to top
View user's profile Send private message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 856

PostPosted: Sun Dec 02, 2007 2:15 pm    Post subject: Reply with quote

Fate is punishing you for something terrible you've done.

Swat is great, as long as everything is set up correctly, but adds a layer of complexity when there are problems, and at least when I tried it, this was the much more critical moment.

The write access from XP is almost certainly a permissions problem. You think you're logging in as yourself but in fact you have some problem with verification (forgot to run smbpasswd for all users?) and you are being mapped to the guest account which of course can't write to anything. I don't think guest accounts are a good thing for exactly that reason. Instead, have a single folder that anybody can write to. If you're paranoid, put it on its own partition. That way non-users who want to hand you large (but not too large! 4GB limit) files can upload them to your public folder.

Also if both swat and cups are complaining that they can't attach to a particular port, that means probably you have iptables rules that prevent it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum