How is “Forwarding can be also done through Unix sockets” done?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












2















https://zaiste.net/ssh_port_forwarding/#remote-port-forwarding




Remote port forwarding is created with -R parameter.



ssh -R source_port:forward_to_host:destination_port via_host 


This command connects to via_host. via_host runs a SSH server. It then
forwards all connection attempts to source_port on the remote via_host
machine to destination_port port on the local machine (a machine that
initiated the ssh command)
. forward_to_host machine must be reachable
from the the local machine machine. Forwarding can be also done
through Unix sockets.




What does "Forwarding can be also done through Unix sockets" mean?
How is that done?



Is ssh remote port forwarding done not through Unix sockets, but Internet sockets?



Thanks.










share|improve this question


























    2















    https://zaiste.net/ssh_port_forwarding/#remote-port-forwarding




    Remote port forwarding is created with -R parameter.



    ssh -R source_port:forward_to_host:destination_port via_host 


    This command connects to via_host. via_host runs a SSH server. It then
    forwards all connection attempts to source_port on the remote via_host
    machine to destination_port port on the local machine (a machine that
    initiated the ssh command)
    . forward_to_host machine must be reachable
    from the the local machine machine. Forwarding can be also done
    through Unix sockets.




    What does "Forwarding can be also done through Unix sockets" mean?
    How is that done?



    Is ssh remote port forwarding done not through Unix sockets, but Internet sockets?



    Thanks.










    share|improve this question
























      2












      2








      2


      1






      https://zaiste.net/ssh_port_forwarding/#remote-port-forwarding




      Remote port forwarding is created with -R parameter.



      ssh -R source_port:forward_to_host:destination_port via_host 


      This command connects to via_host. via_host runs a SSH server. It then
      forwards all connection attempts to source_port on the remote via_host
      machine to destination_port port on the local machine (a machine that
      initiated the ssh command)
      . forward_to_host machine must be reachable
      from the the local machine machine. Forwarding can be also done
      through Unix sockets.




      What does "Forwarding can be also done through Unix sockets" mean?
      How is that done?



      Is ssh remote port forwarding done not through Unix sockets, but Internet sockets?



      Thanks.










      share|improve this question














      https://zaiste.net/ssh_port_forwarding/#remote-port-forwarding




      Remote port forwarding is created with -R parameter.



      ssh -R source_port:forward_to_host:destination_port via_host 


      This command connects to via_host. via_host runs a SSH server. It then
      forwards all connection attempts to source_port on the remote via_host
      machine to destination_port port on the local machine (a machine that
      initiated the ssh command)
      . forward_to_host machine must be reachable
      from the the local machine machine. Forwarding can be also done
      through Unix sockets.




      What does "Forwarding can be also done through Unix sockets" mean?
      How is that done?



      Is ssh remote port forwarding done not through Unix sockets, but Internet sockets?



      Thanks.







      ssh port-forwarding socket






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 5 at 17:37









      TimTim

      27.4k78264474




      27.4k78264474




















          1 Answer
          1






          active

          oldest

          votes


















          4














          Let's look at the real ssh(1) man page instead of that webpage:



           -R [bind_address:]port:host:hostport
          -R [bind_address:]port:local_socket
          -R remote_socket:host:hostport
          -R remote_socket:local_socket


          There are four forms of the -R option, and the one you quoted is the first one. It forwards a TCP port on the system that has the remote end of the SSH connection to the specified host and TCP port number on the local side of the connection.



          The second form describes how to forward a remote TCP port to a local Unix socket:



          ssh -R 1234:/tmp/local_socket user@remote_host


          In other words, when something connects to TCP port 1234 on the remote_host, the connection will be forwarded to Unix socket /tmp/local_socket on the local host.



          The third form describes how to do it the opposite way, remote socket to a TCP port on the local side:



          ssh -R /tmp/remote_socket:1234:somehost user@remote_host


          Here, a process on remote_host can use Unix socket /tmp/remote_socket and the connection will be passed through the SSH connection to the local side, and then over a regular TCP connection to TCP port 1234 of somehost.



          The fourth form describes forwarding from a remote Unix socket to a local one:



          ssh -R /tmp/remote_socket:/tmp/local_socket user@remote_host


          Here, a process on remote_host could open the Unix socket at /tmp/remote_socket to connect to /tmp/local_socket on local host.






          share|improve this answer






















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f498862%2fhow-is-forwarding-can-be-also-done-through-unix-sockets-done%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4














            Let's look at the real ssh(1) man page instead of that webpage:



             -R [bind_address:]port:host:hostport
            -R [bind_address:]port:local_socket
            -R remote_socket:host:hostport
            -R remote_socket:local_socket


            There are four forms of the -R option, and the one you quoted is the first one. It forwards a TCP port on the system that has the remote end of the SSH connection to the specified host and TCP port number on the local side of the connection.



            The second form describes how to forward a remote TCP port to a local Unix socket:



            ssh -R 1234:/tmp/local_socket user@remote_host


            In other words, when something connects to TCP port 1234 on the remote_host, the connection will be forwarded to Unix socket /tmp/local_socket on the local host.



            The third form describes how to do it the opposite way, remote socket to a TCP port on the local side:



            ssh -R /tmp/remote_socket:1234:somehost user@remote_host


            Here, a process on remote_host can use Unix socket /tmp/remote_socket and the connection will be passed through the SSH connection to the local side, and then over a regular TCP connection to TCP port 1234 of somehost.



            The fourth form describes forwarding from a remote Unix socket to a local one:



            ssh -R /tmp/remote_socket:/tmp/local_socket user@remote_host


            Here, a process on remote_host could open the Unix socket at /tmp/remote_socket to connect to /tmp/local_socket on local host.






            share|improve this answer



























              4














              Let's look at the real ssh(1) man page instead of that webpage:



               -R [bind_address:]port:host:hostport
              -R [bind_address:]port:local_socket
              -R remote_socket:host:hostport
              -R remote_socket:local_socket


              There are four forms of the -R option, and the one you quoted is the first one. It forwards a TCP port on the system that has the remote end of the SSH connection to the specified host and TCP port number on the local side of the connection.



              The second form describes how to forward a remote TCP port to a local Unix socket:



              ssh -R 1234:/tmp/local_socket user@remote_host


              In other words, when something connects to TCP port 1234 on the remote_host, the connection will be forwarded to Unix socket /tmp/local_socket on the local host.



              The third form describes how to do it the opposite way, remote socket to a TCP port on the local side:



              ssh -R /tmp/remote_socket:1234:somehost user@remote_host


              Here, a process on remote_host can use Unix socket /tmp/remote_socket and the connection will be passed through the SSH connection to the local side, and then over a regular TCP connection to TCP port 1234 of somehost.



              The fourth form describes forwarding from a remote Unix socket to a local one:



              ssh -R /tmp/remote_socket:/tmp/local_socket user@remote_host


              Here, a process on remote_host could open the Unix socket at /tmp/remote_socket to connect to /tmp/local_socket on local host.






              share|improve this answer

























                4












                4








                4







                Let's look at the real ssh(1) man page instead of that webpage:



                 -R [bind_address:]port:host:hostport
                -R [bind_address:]port:local_socket
                -R remote_socket:host:hostport
                -R remote_socket:local_socket


                There are four forms of the -R option, and the one you quoted is the first one. It forwards a TCP port on the system that has the remote end of the SSH connection to the specified host and TCP port number on the local side of the connection.



                The second form describes how to forward a remote TCP port to a local Unix socket:



                ssh -R 1234:/tmp/local_socket user@remote_host


                In other words, when something connects to TCP port 1234 on the remote_host, the connection will be forwarded to Unix socket /tmp/local_socket on the local host.



                The third form describes how to do it the opposite way, remote socket to a TCP port on the local side:



                ssh -R /tmp/remote_socket:1234:somehost user@remote_host


                Here, a process on remote_host can use Unix socket /tmp/remote_socket and the connection will be passed through the SSH connection to the local side, and then over a regular TCP connection to TCP port 1234 of somehost.



                The fourth form describes forwarding from a remote Unix socket to a local one:



                ssh -R /tmp/remote_socket:/tmp/local_socket user@remote_host


                Here, a process on remote_host could open the Unix socket at /tmp/remote_socket to connect to /tmp/local_socket on local host.






                share|improve this answer













                Let's look at the real ssh(1) man page instead of that webpage:



                 -R [bind_address:]port:host:hostport
                -R [bind_address:]port:local_socket
                -R remote_socket:host:hostport
                -R remote_socket:local_socket


                There are four forms of the -R option, and the one you quoted is the first one. It forwards a TCP port on the system that has the remote end of the SSH connection to the specified host and TCP port number on the local side of the connection.



                The second form describes how to forward a remote TCP port to a local Unix socket:



                ssh -R 1234:/tmp/local_socket user@remote_host


                In other words, when something connects to TCP port 1234 on the remote_host, the connection will be forwarded to Unix socket /tmp/local_socket on the local host.



                The third form describes how to do it the opposite way, remote socket to a TCP port on the local side:



                ssh -R /tmp/remote_socket:1234:somehost user@remote_host


                Here, a process on remote_host can use Unix socket /tmp/remote_socket and the connection will be passed through the SSH connection to the local side, and then over a regular TCP connection to TCP port 1234 of somehost.



                The fourth form describes forwarding from a remote Unix socket to a local one:



                ssh -R /tmp/remote_socket:/tmp/local_socket user@remote_host


                Here, a process on remote_host could open the Unix socket at /tmp/remote_socket to connect to /tmp/local_socket on local host.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 5 at 17:58









                telcoMtelcoM

                18.5k12347




                18.5k12347



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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%2funix.stackexchange.com%2fquestions%2f498862%2fhow-is-forwarding-can-be-also-done-through-unix-sockets-done%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

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay