Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Simple question: I have a NATed Linux at home that hosts a couple of samba shares. What Ports should I forward from the router to the Linux box so as to be able to access those shares from the internet with windows explorer (a la "\my.dyndns.org\shares\xxx" style)? I want the minimum number of port openings that I should do in the router config to have read/write functionality.

EDIT: Client machine is a Vista one

share|improve this question

3 Answers 3

445 for tcp

Contrary to the original answer here, there's no reason to allow 137-139 which should be blocked.

However, I strongly recommend you do not do this. I don't think leaving a samba share internet-accessible is a good idea.

Please please please set up a secure solution such as an ssh server, so that you can scp/sftp data back and forth.

P.s. http://support.microsoft.com/kb/832017 seems to be a good reference of ports required by windows servers and http://www.petri.co.il/whats_port_445_in_w2k_xp_2003.htm explains the above a little more in depth.

share|improve this answer
    
Thanks I am so ** stupid, I ve been trying all day, but forgot UDP... –  Paralife Apr 14 '11 at 8:32
    
Also for the security issue I ll try to do it over ssh tunnels. Wouldnt be this secure enough? –  Paralife Apr 14 '11 at 8:32
    
...btw, can ssh tunneling handle udp connections? –  Paralife Apr 14 '11 at 8:36
1  
Tunneling samba through ssh is certainly possible, here's a guide: axllent.org/docs/networking/samba_over_ssh –  PriceChild Apr 14 '11 at 8:39
1  
139 is not for browsing... Older Windows versions use it for the SMB protocol, wrapped inside a NetBIOS session. So it has exactly the same security issues as 445 (raw SMB). –  grawity Apr 14 '11 at 10:44
  • TCP 139, "NetBIOS Session" – SMB wrapped in NetBIOS for compatibility
  • TCP 445, SMB – the preferred method, SMB directly over TCP
  • ICMP Echo (Ping) – used by Windows to check whether the machine is up.

"NetBIOS Name Service" is TCP/UDP 137, and "NetBIOS Datagram" is UDP 138, but you do not need any of these to connect to shares. These days it is only necessary for "network browsing", which only works within a LAN anyway.

share|improve this answer
    
Aha you're right. Although my 'answer' would have worked i think, I've edited it to the preferred solution. I still reckon openssh is a better way to go. –  PriceChild Apr 14 '11 at 9:35
1  
Vista has a problem making 445 work with forwarding. See my answer for a nice solution link about how to do CIFS over SSH on Vista. –  Paralife Apr 14 '11 at 13:44
up vote 0 down vote accepted

OK here is a guide that could make my grandma do it in 5 mins. Worked without a glitch

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.