Connecting with sftp using a proxy server












1














I am trying to connect to an external server using a proxy with the below command:



sftp -v -o "ProxyCommand /usr/bin/nc -X connect -x proxyserver.com:8080 %h %p" user@server.com


This isn't working. I get the below output:



debug1: Reading configuration data /etc/ssh/ssh_config

debug1: Applying options for *

debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 user@server.com

debug1: permanently_drop_suid: 456876
bash: No such file or directory


I think the command is formed correctly, it appears to be failing at the 'permanently_drop_suid' step. Does anybody have any idea what could be going wrong here? I can connect using WinSCP so the connection details are correct. Any assistance is greatly appreciated!










share|improve this question
















bumped to the homepage by Community 7 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    1














    I am trying to connect to an external server using a proxy with the below command:



    sftp -v -o "ProxyCommand /usr/bin/nc -X connect -x proxyserver.com:8080 %h %p" user@server.com


    This isn't working. I get the below output:



    debug1: Reading configuration data /etc/ssh/ssh_config

    debug1: Applying options for *

    debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 user@server.com

    debug1: permanently_drop_suid: 456876
    bash: No such file or directory


    I think the command is formed correctly, it appears to be failing at the 'permanently_drop_suid' step. Does anybody have any idea what could be going wrong here? I can connect using WinSCP so the connection details are correct. Any assistance is greatly appreciated!










    share|improve this question
















    bumped to the homepage by Community 7 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      1







      I am trying to connect to an external server using a proxy with the below command:



      sftp -v -o "ProxyCommand /usr/bin/nc -X connect -x proxyserver.com:8080 %h %p" user@server.com


      This isn't working. I get the below output:



      debug1: Reading configuration data /etc/ssh/ssh_config

      debug1: Applying options for *

      debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 user@server.com

      debug1: permanently_drop_suid: 456876
      bash: No such file or directory


      I think the command is formed correctly, it appears to be failing at the 'permanently_drop_suid' step. Does anybody have any idea what could be going wrong here? I can connect using WinSCP so the connection details are correct. Any assistance is greatly appreciated!










      share|improve this question















      I am trying to connect to an external server using a proxy with the below command:



      sftp -v -o "ProxyCommand /usr/bin/nc -X connect -x proxyserver.com:8080 %h %p" user@server.com


      This isn't working. I get the below output:



      debug1: Reading configuration data /etc/ssh/ssh_config

      debug1: Applying options for *

      debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 user@server.com

      debug1: permanently_drop_suid: 456876
      bash: No such file or directory


      I think the command is formed correctly, it appears to be failing at the 'permanently_drop_suid' step. Does anybody have any idea what could be going wrong here? I can connect using WinSCP so the connection details are correct. Any assistance is greatly appreciated!







      bash proxy sftp netcat nc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 19 '17 at 10:04









      Romeo Ninov

      5,20231827




      5,20231827










      asked May 19 '17 at 9:58









      R.Smith

      612




      612





      bumped to the homepage by Community 7 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 7 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The last message bash: No such file or directory means that the remote can't find the binary bash for executing. So, it's likely a config issue on the remote side.



          Can you try to connect to server.com using a different user or check the remote 'user@server' setting for the active shell?



          Also, can you ssh to the the remote, eg. ssh -o ProxyCommand... user@server ?



          Right now, i was facing a similar issue, here are my results:



          $ sftp -v -o ConnectTimeout=3 
          -o ProxyCommand='/usr/bin/nc -X connect -x proxyserver.com:8080 %h %p'
          -oPort=443 user@server

          Connecting to server...
          OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
          debug1: Reading configuration data /etc/ssh/ssh_config
          debug1: Applying options for *
          debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 server 443
          [...]
          debug1: permanently_drop_suid: 21889
          debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
          debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH*
          debug1: Enabling compatibility mode for protocol 2.0
          debug1: Local version string SSH-2.0-OpenSSH_5.3
          debug1: SSH2_MSG_KEXINIT sent
          debug1: SSH2_MSG_KEXINIT received
          debug1: kex: server->client aes128-ctr hmac-sha1 none
          debug1: kex: client->server aes128-ctr hmac-sha1 none
          debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
          debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
          debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
          debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
          debug1: checking without port identifier
          The authenticity of host '[server]:443 (<no hostip for proxy command>)' can't be established.
          RSA key fingerprint is <the_finger_print>.
          Are you sure you want to continue connecting (yes/no)? ^C





          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%2f366040%2fconnecting-with-sftp-using-a-proxy-server%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









            0














            The last message bash: No such file or directory means that the remote can't find the binary bash for executing. So, it's likely a config issue on the remote side.



            Can you try to connect to server.com using a different user or check the remote 'user@server' setting for the active shell?



            Also, can you ssh to the the remote, eg. ssh -o ProxyCommand... user@server ?



            Right now, i was facing a similar issue, here are my results:



            $ sftp -v -o ConnectTimeout=3 
            -o ProxyCommand='/usr/bin/nc -X connect -x proxyserver.com:8080 %h %p'
            -oPort=443 user@server

            Connecting to server...
            OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
            debug1: Reading configuration data /etc/ssh/ssh_config
            debug1: Applying options for *
            debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 server 443
            [...]
            debug1: permanently_drop_suid: 21889
            debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
            debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH*
            debug1: Enabling compatibility mode for protocol 2.0
            debug1: Local version string SSH-2.0-OpenSSH_5.3
            debug1: SSH2_MSG_KEXINIT sent
            debug1: SSH2_MSG_KEXINIT received
            debug1: kex: server->client aes128-ctr hmac-sha1 none
            debug1: kex: client->server aes128-ctr hmac-sha1 none
            debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
            debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
            debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
            debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
            debug1: checking without port identifier
            The authenticity of host '[server]:443 (<no hostip for proxy command>)' can't be established.
            RSA key fingerprint is <the_finger_print>.
            Are you sure you want to continue connecting (yes/no)? ^C





            share|improve this answer


























              0














              The last message bash: No such file or directory means that the remote can't find the binary bash for executing. So, it's likely a config issue on the remote side.



              Can you try to connect to server.com using a different user or check the remote 'user@server' setting for the active shell?



              Also, can you ssh to the the remote, eg. ssh -o ProxyCommand... user@server ?



              Right now, i was facing a similar issue, here are my results:



              $ sftp -v -o ConnectTimeout=3 
              -o ProxyCommand='/usr/bin/nc -X connect -x proxyserver.com:8080 %h %p'
              -oPort=443 user@server

              Connecting to server...
              OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
              debug1: Reading configuration data /etc/ssh/ssh_config
              debug1: Applying options for *
              debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 server 443
              [...]
              debug1: permanently_drop_suid: 21889
              debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
              debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH*
              debug1: Enabling compatibility mode for protocol 2.0
              debug1: Local version string SSH-2.0-OpenSSH_5.3
              debug1: SSH2_MSG_KEXINIT sent
              debug1: SSH2_MSG_KEXINIT received
              debug1: kex: server->client aes128-ctr hmac-sha1 none
              debug1: kex: client->server aes128-ctr hmac-sha1 none
              debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
              debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
              debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
              debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
              debug1: checking without port identifier
              The authenticity of host '[server]:443 (<no hostip for proxy command>)' can't be established.
              RSA key fingerprint is <the_finger_print>.
              Are you sure you want to continue connecting (yes/no)? ^C





              share|improve this answer
























                0












                0








                0






                The last message bash: No such file or directory means that the remote can't find the binary bash for executing. So, it's likely a config issue on the remote side.



                Can you try to connect to server.com using a different user or check the remote 'user@server' setting for the active shell?



                Also, can you ssh to the the remote, eg. ssh -o ProxyCommand... user@server ?



                Right now, i was facing a similar issue, here are my results:



                $ sftp -v -o ConnectTimeout=3 
                -o ProxyCommand='/usr/bin/nc -X connect -x proxyserver.com:8080 %h %p'
                -oPort=443 user@server

                Connecting to server...
                OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
                debug1: Reading configuration data /etc/ssh/ssh_config
                debug1: Applying options for *
                debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 server 443
                [...]
                debug1: permanently_drop_suid: 21889
                debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
                debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH*
                debug1: Enabling compatibility mode for protocol 2.0
                debug1: Local version string SSH-2.0-OpenSSH_5.3
                debug1: SSH2_MSG_KEXINIT sent
                debug1: SSH2_MSG_KEXINIT received
                debug1: kex: server->client aes128-ctr hmac-sha1 none
                debug1: kex: client->server aes128-ctr hmac-sha1 none
                debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
                debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
                debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
                debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
                debug1: checking without port identifier
                The authenticity of host '[server]:443 (<no hostip for proxy command>)' can't be established.
                RSA key fingerprint is <the_finger_print>.
                Are you sure you want to continue connecting (yes/no)? ^C





                share|improve this answer












                The last message bash: No such file or directory means that the remote can't find the binary bash for executing. So, it's likely a config issue on the remote side.



                Can you try to connect to server.com using a different user or check the remote 'user@server' setting for the active shell?



                Also, can you ssh to the the remote, eg. ssh -o ProxyCommand... user@server ?



                Right now, i was facing a similar issue, here are my results:



                $ sftp -v -o ConnectTimeout=3 
                -o ProxyCommand='/usr/bin/nc -X connect -x proxyserver.com:8080 %h %p'
                -oPort=443 user@server

                Connecting to server...
                OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
                debug1: Reading configuration data /etc/ssh/ssh_config
                debug1: Applying options for *
                debug1: Executing proxy command: exec /usr/bin/nc -X connect -x proxyserver.com:8080 server 443
                [...]
                debug1: permanently_drop_suid: 21889
                debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
                debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH*
                debug1: Enabling compatibility mode for protocol 2.0
                debug1: Local version string SSH-2.0-OpenSSH_5.3
                debug1: SSH2_MSG_KEXINIT sent
                debug1: SSH2_MSG_KEXINIT received
                debug1: kex: server->client aes128-ctr hmac-sha1 none
                debug1: kex: client->server aes128-ctr hmac-sha1 none
                debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
                debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
                debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
                debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
                debug1: checking without port identifier
                The authenticity of host '[server]:443 (<no hostip for proxy command>)' can't be established.
                RSA key fingerprint is <the_finger_print>.
                Are you sure you want to continue connecting (yes/no)? ^C






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 8 at 9:29









                Thomas Kettenbach

                1012




                1012






























                    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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2f366040%2fconnecting-with-sftp-using-a-proxy-server%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

                    Accessing regular linux commands in Huawei's Dopra Linux

                    Can't connect RFCOMM socket: Host is down

                    Kernel panic - not syncing: Fatal Exception in Interrupt