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!

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.