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.

I'd like to be able to connect from a Windows 7 machine to a Linux box running Samba. I export shares from the Windows machine, so turning off file sharing isn't an option.

I've installed a loopback adapter, but when I try to use it to forward port 139 like this:

ssh -v -L10.11.12.13:139:localhost:139 eimac

I get this in the output:

debug1: Local connections to 10.11.12.13:139 forwarded to remote address localhost:139
    debug1: Local forwarding listening on 10.11.12.13 port 139.
    bind: Address already in use
    channel_setup_fwd_listener: cannot listen to port: 139
    Could not request local forwarding.

Forwarding a different port works - I tried it with port 22 and had no issues.

It seems like Windows is already using port 139 on the loopback adapter, but I've gone into the properties page on the loopback adapter and the only item enabled is Internet Protocol Version 4.

Is there something else I need to do on Windows 7 to tell it not to start anything on port 139 for that adapter?

share|improve this question
2  
FYI, running SMB over NetBIOS (139) is so deprecated that Samba does not even do it. The world now connects to SMB servers directly, over port 445. If you somehow manage to forward 139, it won't be of any use. –  grawity Sep 17 '10 at 14:11

2 Answers 2

Sharing (tunneling) Samba/CIFS/SMB file systems over SSH

  1. Create a virtual network interface and assign a dummy address to it, such as 10.2.3.4
  2. Tell your SSH client to only listen on that interface (-L 10.2.3.4:445:localhost:445)
  3. Open \\10.2.3.4
share|improve this answer

From here:

Port 139 NetBIOS

NetBIOS Session (TCP), Windows File and Printer Sharing

This is the single most dangerous port on the Internet. All "File and Printer Sharing" on a Windows machine runs over this port. About 10% of all users on the Internet leave their hard disks exposed on this port. This is the first port hackers want to connect to, and the port that firewalls block.

So guess what port Windows is listening on for it's shares? It might be possible to change the ports that Windows uses, but then few if any other computers will be able to open your shares, because you'll be using non-standard ports.

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.