LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2003, 07:07 PM   #1
Tezdread
Member
 
Registered: Aug 2002
Location: England
Distribution: SuSE 8.1
Posts: 84

Rep: Reputation: 15
Exclamation Samba (port 139) open to the world


Hi all, I finally got my suse 8 box on my windows network, mapped drives etc.

I netstat and saw that port 139 was open and decided to run a securtiy scan at grc.com and this made a connection to port 139 which as I'm sure you'll agree is not a good situation to be in.

My question is how to keep this port closed to everything other than my local network?

My smb.conf has some stuff in there that I don't know what it is or for. I first only specified my internal network in Allow Hosts but this didn't make any difference so removed it...
Here is is:-

# Samba config file created using SWAT
# from 0.0.0.0 (0.0.0.0)
# Date: 2003/03/08 18:52:57

# Global parameters
[global]
printing = lprng
map to guest = Bad User
veto files = /*.eml/*.nws/riched20.dll/*.{*}/
encrypt passwords = Yes
workgroup = Dreadzone
character set = ISO8859-15
socket options = SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY
netbios name = Pluto
os level = 2
public = yes
default = global

[homes]
comment = Home Directories
read only = No
create mask = 0640
directory mask = 0750
browseable = No

[printers]
comment = All Printers
path = /var/tmp
create mask = 0600
printable = Yes
browseable = No

[downloads]
path = /usr/downloads
comment = This is the root directory for downloads
create mode = 777
writeable = yes
directory mode = 777
public = yes

Could you advise what in this config do I need to do in order to restrict the access to my local network?
 
Old 03-08-2003, 07:32 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
In your global, try adding a hosts allow line. Mine says...

hosts allow = 192.168.1. 127.

It should only allow any computers with an IP of 192.168.1.* or 127.*.*.* to connect then. Change the first one to your network IP range, of course.

And check the man smb.conf to see hosts allow and hosts deny options.
 
Old 03-08-2003, 09:37 PM   #3
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
Yes see man smb.conf and specifically see the use of these:

interfaces = 10.0.23.1
bind interfaces only = yes

Thats an excerpt from my firewalls smb.conf
 
Old 03-09-2003, 07:32 AM   #4
Tezdread
Member
 
Registered: Aug 2002
Location: England
Distribution: SuSE 8.1
Posts: 84

Original Poster
Rep: Reputation: 15
Re: Samba (port 139) open to the world

Thanks for the advise ranger, I thought it was this to start with and it does restrict access (I believe) but it still leaves the port open to external connections which is a security risk.

m0rl0ck thanks for your help again I was hoping that I could restrict it to one nic but wasn't sure if I could do it in the smb.conf or through iptables. Will read up on it...cheers
 
Old 03-09-2003, 10:17 AM   #5
Tezdread
Member
 
Registered: Aug 2002
Location: England
Distribution: SuSE 8.1
Posts: 84

Original Poster
Rep: Reputation: 15
that's got it working I added the following to the end of [global]

bind interfaces only = yes
interfaces = 127.0.0.1, 192.168.1.100

man smb.conf says about including the 127.0.0.1 for swat and password validation.

Tezdread
With every solution comes a new problem (mupheys law)


I found this by mistake (you may already know) and thought it could be useful. When you type in a command and move the cursor somewhere over the command, you can use the PgUp & PgDn keys to scroll trough previous command options that you have previously used. It works in the same way as the up & down arrow keys but just for the current command.
 
  


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
connection refused Samba port 139 cbriscoejr Linux - Networking 4 10-14-2004 10:34 AM
Port 139 jmarsh Linux - Networking 5 03-06-2003 11:01 AM
Port 139 question Chijtska Linux - Security 8 02-20-2002 12:46 PM
samba problems - "PORT 139" vwhk Linux - Networking 1 02-15-2002 04:23 AM
cannot connect to samba server when its running on port 139 badshaaa Linux - Networking 21 02-07-2002 04:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:17 AM.

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