SSH connect to a UNIX socket instead of hostname

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











up vote
3
down vote

favorite
1












Short question:



How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation:



public> ssh /home/username/test.sock
"ssh: Could not resolve hostname: /home/username/test.sock: Name of service not known"


Long Question:



The Problem I try to solve, is to connect from my (public) university server to my (local) PC, which is behind NAT and not visible to public.



The canonical solution is to create a ssh proxy/tunnel to local on public:



local> ssh -NR 2222:localhost:22 public


But this is not possible, as the administration prohibits creating ports.
So I have thought about using UNIX socket instead, which works:



local> ssh -NR /home/username/test.sock:localhost:22 public


But now, how can I connect to it with ssh?







share|improve this question

























    up vote
    3
    down vote

    favorite
    1












    Short question:



    How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation:



    public> ssh /home/username/test.sock
    "ssh: Could not resolve hostname: /home/username/test.sock: Name of service not known"


    Long Question:



    The Problem I try to solve, is to connect from my (public) university server to my (local) PC, which is behind NAT and not visible to public.



    The canonical solution is to create a ssh proxy/tunnel to local on public:



    local> ssh -NR 2222:localhost:22 public


    But this is not possible, as the administration prohibits creating ports.
    So I have thought about using UNIX socket instead, which works:



    local> ssh -NR /home/username/test.sock:localhost:22 public


    But now, how can I connect to it with ssh?







    share|improve this question























      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      Short question:



      How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation:



      public> ssh /home/username/test.sock
      "ssh: Could not resolve hostname: /home/username/test.sock: Name of service not known"


      Long Question:



      The Problem I try to solve, is to connect from my (public) university server to my (local) PC, which is behind NAT and not visible to public.



      The canonical solution is to create a ssh proxy/tunnel to local on public:



      local> ssh -NR 2222:localhost:22 public


      But this is not possible, as the administration prohibits creating ports.
      So I have thought about using UNIX socket instead, which works:



      local> ssh -NR /home/username/test.sock:localhost:22 public


      But now, how can I connect to it with ssh?







      share|improve this question













      Short question:



      How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation:



      public> ssh /home/username/test.sock
      "ssh: Could not resolve hostname: /home/username/test.sock: Name of service not known"


      Long Question:



      The Problem I try to solve, is to connect from my (public) university server to my (local) PC, which is behind NAT and not visible to public.



      The canonical solution is to create a ssh proxy/tunnel to local on public:



      local> ssh -NR 2222:localhost:22 public


      But this is not possible, as the administration prohibits creating ports.
      So I have thought about using UNIX socket instead, which works:



      local> ssh -NR /home/username/test.sock:localhost:22 public


      But now, how can I connect to it with ssh?









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jun 25 at 16:13









      sebasth

      5,78221640




      5,78221640









      asked Jun 25 at 15:24









      bvolkmer

      1747




      1747




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          6
          down vote



          accepted










          You should be able to do utilizing socat and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat establishes two-way communication between STDIN/STDOUT (socat and ssh client) and your UNIX socket.



          ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo





          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f451788%2fssh-connect-to-a-unix-socket-instead-of-hostname%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            6
            down vote



            accepted










            You should be able to do utilizing socat and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat establishes two-way communication between STDIN/STDOUT (socat and ssh client) and your UNIX socket.



            ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo





            share|improve this answer



























              up vote
              6
              down vote



              accepted










              You should be able to do utilizing socat and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat establishes two-way communication between STDIN/STDOUT (socat and ssh client) and your UNIX socket.



              ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo





              share|improve this answer

























                up vote
                6
                down vote



                accepted







                up vote
                6
                down vote



                accepted






                You should be able to do utilizing socat and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat establishes two-way communication between STDIN/STDOUT (socat and ssh client) and your UNIX socket.



                ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo





                share|improve this answer















                You should be able to do utilizing socat and ProxyCommand option for ssh. ProxyCommand configures ssh client to use proxy process for communicating with your server. socat establishes two-way communication between STDIN/STDOUT (socat and ssh client) and your UNIX socket.



                ssh -o "ProxyCommand socat - UNIX-CLIENT:/home/username/test.sock" foo






                share|improve this answer















                share|improve this answer



                share|improve this answer








                edited Jun 25 at 15:54


























                answered Jun 25 at 15:34









                sebasth

                5,78221640




                5,78221640






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451788%2fssh-connect-to-a-unix-socket-instead-of-hostname%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    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