Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Samba: localhost is fine, but nowhere else (RESOLVED)
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
frozenJim
Guru
Guru


Joined: 18 Jun 2004
Posts: 341
Location: Montreal, Quebec, Canada

PostPosted: Tue Aug 09, 2005 2:44 am    Post subject: Samba: localhost is fine, but nowhere else (RESOLVED) Reply with quote

Hi, new to Samba. I have set up my samba server on Gentoo
I have no problem accessing the windows machines with smbclient but nobody can see my Samba server. Not even the Samba server - unless I connect to localhost. (PC name is thorn, netbios name is thorn in smb.conf)
I am working with the //thorn/tmp share so don't worry too much about other misconfigured shares ;-)

This works:
Code:
# smbclient //localhost/tmp -U=guest
Password:
Domain=[THORN] OS=[Unix] Server=[Samba 3.0.14a]
smb: \> exit


This fails:
Code:
# smbclient //thorn/tmp -U=guest
Password:
tree connect failed: Call returned zero bytes (EOF)

My samba server is not visible to any other computers on the windows workgroup and there is no way to get connected.

What have I done wrong?

TESTPARM OUTPUT:
Code:
thorn log # testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[tmp]"
Processing section "[officejet]"
Processing section "[test]"
Loaded services file OK.
Warning: Service printers defines a print command, but print command parameter is ignored when using CUPS libraries.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

# Global parameters
[global]
        workgroup = FLOWER
        server string = Samba Server %v
        interfaces = lo, eth0
        bind interfaces only = Yes
        smb passwd file = /etc/samba/private/smbpasswd
        passdb backend = tdbsam
        guest account = samba
        log file = /var/log/samba3/log.%m
        max log size = 50
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        printcap name = cups
        disable spoolss = Yes
        show add printer wizard = No
        dns proxy = No
        comment = Whazzuppp!!!!
        printer admin = root
        guest ok = Yes
        hosts allow = 192.168.2.0/255, 127.0.0.1/8
        hosts deny = 0.0.0.0/0
        cups options = "raw"
        printer name = officejet
        hide unreadable = Yes

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        read only = No
        create mask = 0700
        printable = Yes
        print command = lpr-cups -P %p -o raw %s -r   # using client side printer drivers.
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers/W32X86
        write list = root
        read only = No

[tmp]
        comment = Temporary file space
        path = /tmp
        read only = No

[officejet]
        comment = OfficeJet on thorn(LINUX)
        path = /var/spool/officejet
        printable = Yes

[test]
        comment = let's see how THIS works out...
        path = /mydocuments
        read only = No
        printable = Yes


SBM.CONF
Code:

[global]
   
   log file = /var/log/samba3/log.%m
   hosts allow = 192.168.2.0/255 127.0.0.1/8
   hosts deny = 0.0.0.0/0
   interfaces = lo eth0
   bind interfaces only = yes
   printer = officejet
   smb passwd file = /etc/samba/private/smbpasswd
   load printers = yes
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
   #map to guest = bad user
   #encrypt passwords = yes
   #null passwords = no
   hide unreadable = yes
   hide dot files = yes
   passdb backend = tdbsam
   printer admin = root
   dns proxy = no
   guest account = samba
   guest ok = yes
   server string = Samba Server %v
   printing = cups
   cups options = "raw"
   use client driver = no
   workgroup = Flower
   netbios name = thorn
   comment = Whazzuppp!!!!
   printcap name = cups
   disable spoolss = Yes
   show add printer wizard = No
   security = user
   max log size = 50
   local master = yes

[homes]
   comment = Home Directories
   browseable = no
   writable = yes

[printers]
   comment = All Printers
   path = /var/spool/samba
   browseable = yes
   guest ok = yes
   writable = yes
   printable = yes
   printer admin = root
   create mode = 0700
# =====================================
# print command: see above for details.
# =====================================
   print command = lpr-cups -P %p -o raw %s -r   # using


[print$]
   comment = Printer Drivers
   #path = /etc/samba/drivers
   #path = /usr/share/cups/drivers
   path = /var/lib/samba/printers/W32X86
   browseable = yes
   read only = no
   write list = root
   guest ok = yes

[tmp]
   comment = Temporary file space
   path = /tmp
   read only = no
   public = yes


[officejet]
comment = OfficeJet on thorn(LINUX)
printable = yes
path = /var/spool/officejet
public = yes
guest ok = yes
printer admin = root
use client driver = no

[test]
   comment = let's see how THIS works out...
   guest ok = yes
   browsable = yes
   writable = yes
   printable = yes
   path = /mydocuments


_________________
Who controls the past, controls the future. Who controls the present, controls the past.


Last edited by frozenJim on Wed Aug 10, 2005 2:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
electrofreak
l33t
l33t


Joined: 30 Jun 2004
Posts: 713
Location: Ohio, USA

PostPosted: Tue Aug 09, 2005 2:52 am    Post subject: Reply with quote

Do you have "thorn" in your /etc/hosts on the computer you're using to connect to it? Try it with the IP address and see what happens.
_________________
Desktop: ABit AN8, Athlon64 X2 4400+ 939 2.75GHz, 2x1GB Corsair XMS DDR400, 2x160GB SATA RAID-0, 2x20"W, Vista Ultimate x64
Laptop: 15.4" MacBook Pro 2.4Ghz, 2x1GB RAM, 160GB, Mac OS X 10.5.1
Server: PIII 550Mhz, 3x128MB RAM, 160GB, Ubuntu Server 7.10
Back to top
View user's profile Send private message
frozenJim
Guru
Guru


Joined: 18 Jun 2004
Posts: 341
Location: Montreal, Quebec, Canada

PostPosted: Tue Aug 09, 2005 3:09 am    Post subject: Reply with quote

electrofreak wrote:
Do you have "thorn" in your /etc/hosts on the computer you're using to connect to it? Try it with the IP address and see what happens.

Yes, it's there - although you did get me to doublecheck it after some self-doubt.

I am actually on the server (thorn) itself so I am surprised that //thorn/tmp is not recognized when //localhost/tmp is. This has to be something silly I think.
_________________
Who controls the past, controls the future. Who controls the present, controls the past.
Back to top
View user's profile Send private message
fixer
n00b
n00b


Joined: 23 Aug 2002
Posts: 33

PostPosted: Tue Aug 09, 2005 6:27 am    Post subject: Reply with quote

try changing the interfaces line in /etc/samba/smb.conf from:

Code:

        interfaces = lo, eth0


to:

Code:

        interfaces = 192.168.2.?, eth0


where ? is the final digit in the IP address of your server. I had similar trouble to yours until I mae that change. It should be noted that the role of my samba server is different from yours.

-fixer
Back to top
View user's profile Send private message
DaveArb
Guru
Guru


Joined: 29 Apr 2004
Posts: 510
Location: Texas, USA

PostPosted: Tue Aug 09, 2005 1:41 pm    Post subject: Re: Samba: localhost is fine, but nowhere else Reply with quote

frozenJim wrote:
Code:
hosts allow = 192.168.2.0/255


That isn't valid CIDR notation. You probably meant 192.168.2.0/24? I don't know if it's the cause of your problem though.

Dave
Back to top
View user's profile Send private message
frozenJim
Guru
Guru


Joined: 18 Jun 2004
Posts: 341
Location: Montreal, Quebec, Canada

PostPosted: Wed Aug 10, 2005 10:16 am    Post subject: Re: Samba: localhost is fine, but nowhere else Reply with quote

DaveArb wrote:
frozenJim wrote:
Code:
hosts allow = 192.168.2.0/255


That isn't valid CIDR notation. You probably meant 192.168.2.0/24? I don't know if it's the cause of your problem though.

Dave


Really? I had assumed that the 0/255 meant that I was allowing all addresses in that range. Following THAT train of logic, I would think that 0/24 would not allow 192168.2.25 to access the share.

Now the operative word here is ASSUME :oops: and we know how that word breaks down. What does the 0/24 mean then? This may be important.
_________________
Who controls the past, controls the future. Who controls the present, controls the past.
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Wed Aug 10, 2005 1:05 pm    Post subject: Reply with quote

/24 = 24 bit subnet mask. This is 255.255.255.0, where 255 = 8 bits.
Back to top
View user's profile Send private message
DaveArb
Guru
Guru


Joined: 29 Apr 2004
Posts: 510
Location: Texas, USA

PostPosted: Wed Aug 10, 2005 1:45 pm    Post subject: Reply with quote

To expand a bit (heh, sorry) on magic919's answer, CIDR slash notation tells how many bits cannot change in the subnet. So, /24 says the first 24 bits must stay the same. A /8 says only the first 8 bits must stay the same, same as a netmask of 255.0.0.0. The numbers don't have to be an exact byte multiple, you can just as easily have a /29 network, which is what my company has on the Internet. This yields 6 usable IPs (8 total) with a netmask of 255.255.255.248.

www.dnsstuff.com has a neat CIDR "calculator", middle row almost at the bottom.

Dave
Back to top
View user's profile Send private message
frozenJim
Guru
Guru


Joined: 18 Jun 2004
Posts: 341
Location: Montreal, Quebec, Canada

PostPosted: Wed Aug 10, 2005 2:47 pm    Post subject: Cannot access samba server from XP (RESOLVED) Reply with quote

Thanks for the lesson on subnetting! Sure enough, after the changes:
Code:
hosts allow = 192.168.2.0/24 127.0.0.1/8
#interfaces = lo eth0
interfaces = 192.168.2.3, eth0
I can now connect (locally only) using:
Code:
smbclient //thorn/tmp -U=guest
and NOT using:
Code:
smbclient //localhost/tmp -U=guest

Trying to connect from a windows computer (192.168.2.5) goes along just fine as I map a drive as user guest. It asks me for my password (which should be blank for guest) over and over. Checking my /var/log/messages, I find that every time I enter the password on the XP machine, I get the "endpoint is not connected" in my log. When I abandon the effort, I get the "Connection reset by peer" error:
Code:
Aug 10 10:09:09 thorn smbd[21404]: [2005/08/10 10:09:09, 0] lib/util_sock.c:get_peer_addr(1150)
Aug 10 10:09:09 thorn smbd[21404]:   getpeername failed. Error was Transport endpoint is not connected
Aug 10 10:09:09 thorn smbd[21404]: [2005/08/10 10:09:09, 0] lib/access.c:check_access(328)
Aug 10 10:09:09 thorn smbd[21404]: [2005/08/10 10:09:09, 0] lib/util_sock.c:get_peer_addr(1150)
Aug 10 10:09:09 thorn smbd[21404]:   getpeername failed. Error was Transport endpoint is not connected
Aug 10 10:09:09 thorn smbd[21404]:   Denied connection from  (0.0.0.0)
Aug 10 10:09:09 thorn smbd[21404]: [2005/08/10 10:09:09, 0] lib/util_sock.c:get_peer_addr(1150)
Aug 10 10:09:09 thorn smbd[21404]:   getpeername failed. Error was Transport endpoint is not connected
Aug 10 10:09:09 thorn smbd[21404]:   Connection denied from 0.0.0.0
Aug 10 10:09:09 thorn smbd[21404]: [2005/08/10 10:09:09, 0] lib/util_sock.c:write_socket_data(430)
Aug 10 10:09:09 thorn smbd[21404]:   write_socket_data: write failure. Error = Connection reset by peer
Aug 10 10:09:09 thorn smbd[21404]: [2005/08/10 10:09:09, 0] lib/util_sock.c:write_socket(455)
Aug 10 10:09:09 thorn smbd[21404]:   write_socket: Error writing 5 bytes to socket 24: ERRNO = Connection reset by peer

-------------------------------
So a quick change to /etc/samba/smb.conf sets me up to connect succesfully using localhost AND thorn:
Code:
hosts allow = 192.168.2.0/24, 127.0.0.1
#interfaces = lo eth0
interfaces = 192.168.2.3, eth0, lo

From the XP machine I still cannot connect using \\thorn\tmp - but I CAN connect using 192.168.2.3\tmp. So I'm a lot closer now. Since thorn IS in the hosts file on the XP machine, I know that it's on my samba server that I need to make the change.
Following this logic, I experimented with putting "thorn" into my smb.conf and IT WORKS FROM XP!!!
Code:
interfaces = 192.168.2.3, eth0, lo, thorn

-------------------------------
I don't know if I've broken any major rules here... but it's working well and I feel a lot more comfortable with my understanding of Samba.

THANKS ALL!!
_________________
Who controls the past, controls the future. Who controls the present, controls the past.
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