SSH tunnel on Windows 10 to Linux SambaAn SSH tunnel via multiple hopsHow do I forward port 139 on Windows 7...

What does it take to become a wilderness skills guide as a business?

How to distinguish easily different soldier of ww2?

What is the purpose of a disclaimer like "this is not legal advice"?

Why would /etc/passwd be used every time someone executes `ls -l` command?

Why does a car's steering wheel get lighter with increasing speed

When Central Limit Theorem breaks down

What does "rhumatis" mean?

If nine coins are tossed, what is the probability that the number of heads is even?

Why aren't there more Gauls like Obelix?

3.5% Interest Student Loan or use all of my savings on Tuition?

Insult for someone who "doesn't know anything"

Propulsion Systems

ESPP--any reason not to go all in?

Giving a career talk in my old university, how prominently should I tell students my salary?

Professor forcing me to attend a conference, I can't afford even with 50% funding

Use Mercury as quenching liquid for swords?

Is "cogitate" used appropriately in "I cogitate that success relies on hard work"?

Can I challenge the interviewer to give me a proper technical feedback?

Does an unused member variable take up memory?

Is there a math expression equivalent to the conditional ternary operator?

Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?

Does the US political system, in principle, allow for a no-party system?

Where is the License file location for Identity Server in Sitecore 9.1?

Is the differential, dp, exact or not?



SSH tunnel on Windows 10 to Linux Samba


An SSH tunnel via multiple hopsHow do I forward port 139 on Windows 7 using SSH on a loopback adapter?CIFS Share Mount ErrorDoes availability of outbound SSH connection means SSH tunnel possible?Permission denied while mounting samba cifs share on linuxHow to mount a samba share on non-standard port?CIFS mount over VPN hangs when VPN crashes and reconnectsVNC over Reverse SSH Tunnel or VPN?How to tunnel network share directly to share's host?Accessing a Windows 10 share via Ubuntu/CIFS over OpenVPN













3















I know This question has been asked a few times already but I think my problem might be slightly different. Maybe I'm not understanding the fundamentals of the issue.



I have a Linux Samba share that I would like to ssh tunnel and use from Windows. When I am on the VPN I can access the Samba share and tunneling port 139 works fine on Linux.
When I access the share from a Linux machine that is off the VPN all I need to do is forward port 139 like so:



ssh user@remotehost -L 1139:localhost:139


And then mount the drive:



mount -t cifs //remotehost/shared /mnt/cifs -o username=myuser,password=mypass,ip=127.0.0.1,port=1139


For Windows I tried following a tutorial to create a loopback adapter and tunnel via PuTTY: http://www.nikhef.nl/~janjust/CifsOverSSH/Win8Loopback.html



This didn't work so I tried following a different tutorial that uses port 139 instead of 445: https://www.simonholywell.com/post/2009/04/samba-file-share-over-ssh-tunnel/



Neither of this tutorials worked so I guess my first question is which of these ports do I actually need to forward? Do I need port 139, port 445, or both? I don't see what the issue could be.



Let me know if you need any other info, I have tried using nmap to troubleshoot but haven't gotten anywhere.










share|improve this question



























    3















    I know This question has been asked a few times already but I think my problem might be slightly different. Maybe I'm not understanding the fundamentals of the issue.



    I have a Linux Samba share that I would like to ssh tunnel and use from Windows. When I am on the VPN I can access the Samba share and tunneling port 139 works fine on Linux.
    When I access the share from a Linux machine that is off the VPN all I need to do is forward port 139 like so:



    ssh user@remotehost -L 1139:localhost:139


    And then mount the drive:



    mount -t cifs //remotehost/shared /mnt/cifs -o username=myuser,password=mypass,ip=127.0.0.1,port=1139


    For Windows I tried following a tutorial to create a loopback adapter and tunnel via PuTTY: http://www.nikhef.nl/~janjust/CifsOverSSH/Win8Loopback.html



    This didn't work so I tried following a different tutorial that uses port 139 instead of 445: https://www.simonholywell.com/post/2009/04/samba-file-share-over-ssh-tunnel/



    Neither of this tutorials worked so I guess my first question is which of these ports do I actually need to forward? Do I need port 139, port 445, or both? I don't see what the issue could be.



    Let me know if you need any other info, I have tried using nmap to troubleshoot but haven't gotten anywhere.










    share|improve this question

























      3












      3








      3








      I know This question has been asked a few times already but I think my problem might be slightly different. Maybe I'm not understanding the fundamentals of the issue.



      I have a Linux Samba share that I would like to ssh tunnel and use from Windows. When I am on the VPN I can access the Samba share and tunneling port 139 works fine on Linux.
      When I access the share from a Linux machine that is off the VPN all I need to do is forward port 139 like so:



      ssh user@remotehost -L 1139:localhost:139


      And then mount the drive:



      mount -t cifs //remotehost/shared /mnt/cifs -o username=myuser,password=mypass,ip=127.0.0.1,port=1139


      For Windows I tried following a tutorial to create a loopback adapter and tunnel via PuTTY: http://www.nikhef.nl/~janjust/CifsOverSSH/Win8Loopback.html



      This didn't work so I tried following a different tutorial that uses port 139 instead of 445: https://www.simonholywell.com/post/2009/04/samba-file-share-over-ssh-tunnel/



      Neither of this tutorials worked so I guess my first question is which of these ports do I actually need to forward? Do I need port 139, port 445, or both? I don't see what the issue could be.



      Let me know if you need any other info, I have tried using nmap to troubleshoot but haven't gotten anywhere.










      share|improve this question














      I know This question has been asked a few times already but I think my problem might be slightly different. Maybe I'm not understanding the fundamentals of the issue.



      I have a Linux Samba share that I would like to ssh tunnel and use from Windows. When I am on the VPN I can access the Samba share and tunneling port 139 works fine on Linux.
      When I access the share from a Linux machine that is off the VPN all I need to do is forward port 139 like so:



      ssh user@remotehost -L 1139:localhost:139


      And then mount the drive:



      mount -t cifs //remotehost/shared /mnt/cifs -o username=myuser,password=mypass,ip=127.0.0.1,port=1139


      For Windows I tried following a tutorial to create a loopback adapter and tunnel via PuTTY: http://www.nikhef.nl/~janjust/CifsOverSSH/Win8Loopback.html



      This didn't work so I tried following a different tutorial that uses port 139 instead of 445: https://www.simonholywell.com/post/2009/04/samba-file-share-over-ssh-tunnel/



      Neither of this tutorials worked so I guess my first question is which of these ports do I actually need to forward? Do I need port 139, port 445, or both? I don't see what the issue could be.



      Let me know if you need any other info, I have tried using nmap to troubleshoot but haven't gotten anywhere.







      windows-10 ssh samba ssh-tunnel cifs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 29 '16 at 13:18









      Blake WregeBlake Wrege

      18116




      18116






















          2 Answers
          2






          active

          oldest

          votes


















          2














          You should only need to forward port 445. In putty the local port should be loopbackIP:44445(or any other unused port) and the forward destination should be localhost:445 or 127.0.0.1:445.



          It worked for me follow the procedure in this link: http://how-to.cc/setup-windows-filesharing-over-ssh



          Note that all reference to the service 'smb' needs to be changed to the service 'server'.



          If it still doesn't work you can try disabling samba v3 on the windows box or try upgrading samba on the linux server. See this link https://it.awroblew.biz/windows-10-and-problems-accessing-smb-shares/






          share|improve this answer
























          • Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.

            – DavidPostill
            Sep 23 '16 at 8:22



















          0














          how to proxy smb to a windows 10 client:



          short description with ssh n stuff for tunneling




          1. launch hdwwiz.exe

          2. network adapters -> Microsoft KM-TEST Loopback Adapter -> finish

          3. disable everything except ipv4 in that new network sink

          4. inside the ipv4 settings set up a ip, 255.255.255.255 as subnet mask and disable netbios


            • if you cannot decide on an ip simply use 192.0.2.123 since it's not a public ip and most likely will never be used in a LAN environment. (in case you care about vpn compatibility)



          5. elevated windows shell


            • run sc config lanmanserver start= delayed-auto

              this is sadly required since microsoft will bind it's smb bullshit to 0.0.0.0:445 thus making it impossible to listen to that port yourself.

              microsoft also does not want you to use smb on a port different than 445.

            • run netsh interface portproxy add v4tov4 listenaddress=192.0.2.123 listenport=445 connectaddress=192.0.2.123 connectport=44445

              this will ensure that 445 stays bound as soon as lanmanserver starts. thus making it possible for you to just spawn a listener onto 44445 to listen to 445 without eaddrinuse errors etc.



          6. edit %windir%system32driversetchosts and add an appropriate mapping like:
            192.0.2.123 smbproxy

          7. reboot

          8. just use ssh -L 192.0.2.123:44445:yoursmbhost:445

          9. open explorer and navigate to \smbproxy


          you can also create multiple mappings in your hosts file for that.

          the benefit would be that multiple users of your laptop / pc could access your nas with different usernames / sessions without windows annoying you that someone else is already using that resource.



          feel free to open the task creation tool of windows to start this on system startup.



          this was taken from my readme.md i made for my websocket proxy https://gitfap.de/GottZ/websocketproxy






          share|improve this answer








          New contributor




          GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1094931%2fssh-tunnel-on-windows-10-to-linux-samba%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            You should only need to forward port 445. In putty the local port should be loopbackIP:44445(or any other unused port) and the forward destination should be localhost:445 or 127.0.0.1:445.



            It worked for me follow the procedure in this link: http://how-to.cc/setup-windows-filesharing-over-ssh



            Note that all reference to the service 'smb' needs to be changed to the service 'server'.



            If it still doesn't work you can try disabling samba v3 on the windows box or try upgrading samba on the linux server. See this link https://it.awroblew.biz/windows-10-and-problems-accessing-smb-shares/






            share|improve this answer
























            • Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.

              – DavidPostill
              Sep 23 '16 at 8:22
















            2














            You should only need to forward port 445. In putty the local port should be loopbackIP:44445(or any other unused port) and the forward destination should be localhost:445 or 127.0.0.1:445.



            It worked for me follow the procedure in this link: http://how-to.cc/setup-windows-filesharing-over-ssh



            Note that all reference to the service 'smb' needs to be changed to the service 'server'.



            If it still doesn't work you can try disabling samba v3 on the windows box or try upgrading samba on the linux server. See this link https://it.awroblew.biz/windows-10-and-problems-accessing-smb-shares/






            share|improve this answer
























            • Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.

              – DavidPostill
              Sep 23 '16 at 8:22














            2












            2








            2







            You should only need to forward port 445. In putty the local port should be loopbackIP:44445(or any other unused port) and the forward destination should be localhost:445 or 127.0.0.1:445.



            It worked for me follow the procedure in this link: http://how-to.cc/setup-windows-filesharing-over-ssh



            Note that all reference to the service 'smb' needs to be changed to the service 'server'.



            If it still doesn't work you can try disabling samba v3 on the windows box or try upgrading samba on the linux server. See this link https://it.awroblew.biz/windows-10-and-problems-accessing-smb-shares/






            share|improve this answer













            You should only need to forward port 445. In putty the local port should be loopbackIP:44445(or any other unused port) and the forward destination should be localhost:445 or 127.0.0.1:445.



            It worked for me follow the procedure in this link: http://how-to.cc/setup-windows-filesharing-over-ssh



            Note that all reference to the service 'smb' needs to be changed to the service 'server'.



            If it still doesn't work you can try disabling samba v3 on the windows box or try upgrading samba on the linux server. See this link https://it.awroblew.biz/windows-10-and-problems-accessing-smb-shares/







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 23 '16 at 2:22









            MattMatt

            362




            362













            • Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.

              – DavidPostill
              Sep 23 '16 at 8:22



















            • Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.

              – DavidPostill
              Sep 23 '16 at 8:22

















            Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.

            – DavidPostill
            Sep 23 '16 at 8:22





            Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.

            – DavidPostill
            Sep 23 '16 at 8:22













            0














            how to proxy smb to a windows 10 client:



            short description with ssh n stuff for tunneling




            1. launch hdwwiz.exe

            2. network adapters -> Microsoft KM-TEST Loopback Adapter -> finish

            3. disable everything except ipv4 in that new network sink

            4. inside the ipv4 settings set up a ip, 255.255.255.255 as subnet mask and disable netbios


              • if you cannot decide on an ip simply use 192.0.2.123 since it's not a public ip and most likely will never be used in a LAN environment. (in case you care about vpn compatibility)



            5. elevated windows shell


              • run sc config lanmanserver start= delayed-auto

                this is sadly required since microsoft will bind it's smb bullshit to 0.0.0.0:445 thus making it impossible to listen to that port yourself.

                microsoft also does not want you to use smb on a port different than 445.

              • run netsh interface portproxy add v4tov4 listenaddress=192.0.2.123 listenport=445 connectaddress=192.0.2.123 connectport=44445

                this will ensure that 445 stays bound as soon as lanmanserver starts. thus making it possible for you to just spawn a listener onto 44445 to listen to 445 without eaddrinuse errors etc.



            6. edit %windir%system32driversetchosts and add an appropriate mapping like:
              192.0.2.123 smbproxy

            7. reboot

            8. just use ssh -L 192.0.2.123:44445:yoursmbhost:445

            9. open explorer and navigate to \smbproxy


            you can also create multiple mappings in your hosts file for that.

            the benefit would be that multiple users of your laptop / pc could access your nas with different usernames / sessions without windows annoying you that someone else is already using that resource.



            feel free to open the task creation tool of windows to start this on system startup.



            this was taken from my readme.md i made for my websocket proxy https://gitfap.de/GottZ/websocketproxy






            share|improve this answer








            New contributor




            GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              0














              how to proxy smb to a windows 10 client:



              short description with ssh n stuff for tunneling




              1. launch hdwwiz.exe

              2. network adapters -> Microsoft KM-TEST Loopback Adapter -> finish

              3. disable everything except ipv4 in that new network sink

              4. inside the ipv4 settings set up a ip, 255.255.255.255 as subnet mask and disable netbios


                • if you cannot decide on an ip simply use 192.0.2.123 since it's not a public ip and most likely will never be used in a LAN environment. (in case you care about vpn compatibility)



              5. elevated windows shell


                • run sc config lanmanserver start= delayed-auto

                  this is sadly required since microsoft will bind it's smb bullshit to 0.0.0.0:445 thus making it impossible to listen to that port yourself.

                  microsoft also does not want you to use smb on a port different than 445.

                • run netsh interface portproxy add v4tov4 listenaddress=192.0.2.123 listenport=445 connectaddress=192.0.2.123 connectport=44445

                  this will ensure that 445 stays bound as soon as lanmanserver starts. thus making it possible for you to just spawn a listener onto 44445 to listen to 445 without eaddrinuse errors etc.



              6. edit %windir%system32driversetchosts and add an appropriate mapping like:
                192.0.2.123 smbproxy

              7. reboot

              8. just use ssh -L 192.0.2.123:44445:yoursmbhost:445

              9. open explorer and navigate to \smbproxy


              you can also create multiple mappings in your hosts file for that.

              the benefit would be that multiple users of your laptop / pc could access your nas with different usernames / sessions without windows annoying you that someone else is already using that resource.



              feel free to open the task creation tool of windows to start this on system startup.



              this was taken from my readme.md i made for my websocket proxy https://gitfap.de/GottZ/websocketproxy






              share|improve this answer








              New contributor




              GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                0












                0








                0







                how to proxy smb to a windows 10 client:



                short description with ssh n stuff for tunneling




                1. launch hdwwiz.exe

                2. network adapters -> Microsoft KM-TEST Loopback Adapter -> finish

                3. disable everything except ipv4 in that new network sink

                4. inside the ipv4 settings set up a ip, 255.255.255.255 as subnet mask and disable netbios


                  • if you cannot decide on an ip simply use 192.0.2.123 since it's not a public ip and most likely will never be used in a LAN environment. (in case you care about vpn compatibility)



                5. elevated windows shell


                  • run sc config lanmanserver start= delayed-auto

                    this is sadly required since microsoft will bind it's smb bullshit to 0.0.0.0:445 thus making it impossible to listen to that port yourself.

                    microsoft also does not want you to use smb on a port different than 445.

                  • run netsh interface portproxy add v4tov4 listenaddress=192.0.2.123 listenport=445 connectaddress=192.0.2.123 connectport=44445

                    this will ensure that 445 stays bound as soon as lanmanserver starts. thus making it possible for you to just spawn a listener onto 44445 to listen to 445 without eaddrinuse errors etc.



                6. edit %windir%system32driversetchosts and add an appropriate mapping like:
                  192.0.2.123 smbproxy

                7. reboot

                8. just use ssh -L 192.0.2.123:44445:yoursmbhost:445

                9. open explorer and navigate to \smbproxy


                you can also create multiple mappings in your hosts file for that.

                the benefit would be that multiple users of your laptop / pc could access your nas with different usernames / sessions without windows annoying you that someone else is already using that resource.



                feel free to open the task creation tool of windows to start this on system startup.



                this was taken from my readme.md i made for my websocket proxy https://gitfap.de/GottZ/websocketproxy






                share|improve this answer








                New contributor




                GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                how to proxy smb to a windows 10 client:



                short description with ssh n stuff for tunneling




                1. launch hdwwiz.exe

                2. network adapters -> Microsoft KM-TEST Loopback Adapter -> finish

                3. disable everything except ipv4 in that new network sink

                4. inside the ipv4 settings set up a ip, 255.255.255.255 as subnet mask and disable netbios


                  • if you cannot decide on an ip simply use 192.0.2.123 since it's not a public ip and most likely will never be used in a LAN environment. (in case you care about vpn compatibility)



                5. elevated windows shell


                  • run sc config lanmanserver start= delayed-auto

                    this is sadly required since microsoft will bind it's smb bullshit to 0.0.0.0:445 thus making it impossible to listen to that port yourself.

                    microsoft also does not want you to use smb on a port different than 445.

                  • run netsh interface portproxy add v4tov4 listenaddress=192.0.2.123 listenport=445 connectaddress=192.0.2.123 connectport=44445

                    this will ensure that 445 stays bound as soon as lanmanserver starts. thus making it possible for you to just spawn a listener onto 44445 to listen to 445 without eaddrinuse errors etc.



                6. edit %windir%system32driversetchosts and add an appropriate mapping like:
                  192.0.2.123 smbproxy

                7. reboot

                8. just use ssh -L 192.0.2.123:44445:yoursmbhost:445

                9. open explorer and navigate to \smbproxy


                you can also create multiple mappings in your hosts file for that.

                the benefit would be that multiple users of your laptop / pc could access your nas with different usernames / sessions without windows annoying you that someone else is already using that resource.



                feel free to open the task creation tool of windows to start this on system startup.



                this was taken from my readme.md i made for my websocket proxy https://gitfap.de/GottZ/websocketproxy







                share|improve this answer








                New contributor




                GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 9 hours ago









                GottZGottZ

                1012




                1012




                New contributor




                GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                GottZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1094931%2fssh-tunnel-on-windows-10-to-linux-samba%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

                    VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

                    Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...