开发者

Proxy Details with SFTP command

I'm trying to login into the sftp server but its giving me this

Connecting to sftp.ABCD.com...
/bin/sh: line 1: exec: connect: not found
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer

These are the credentials that I'm trying to give

The credentials for the sftp server is below:

SFTP servers information:

Proxy Address: proxy.ABCD.com Host name: sftp.ABCD.com Port: 32 User Name: wakao Password: 123!@#

I tried with several combi开发者_如何学JAVAnations but I couldn't arrive at a conclusion as in where and why its giving me the above mentioned message

sftp -o "ProxyCommand  connect -S proxy.ABCD.com:80"   wakao@sftp.ABCD.com:32
sftp -o "ProxyCommand  connect -S proxy.ABCD.com:80    %h    %p"  wakao@sftp.ABCD.com:32

Where am I going wrong? Or how to specify the command properly? Thanks in advance!


As Schot said I contacted the System Administrator & after installing the connect the command is:

sftp -o "ProxyCommand connect -H proxy.ABCD.com:80 %h %p" wakao@sftp.ABCD.com


The problem is that the shell on the SFTP server cannot find the command connect. Two likely causes:

  1. Your $PATH is not set. Try replacing connect with /usr/bin/connect or $(which connect). Or login with SSH and locate this program.
  2. The SFTP server does not have connect installed. Contact the system administrator of the machine.


In RHEL/CentOS 7 clients and Linux versions where the nc command doesn't recognize the -x and -X command-line arguments (e.g. Ncat: Version 7.50), the working command would be:

sftp  -o ConnectTimeout=3 -o ProxyCommand='/usr/bin/nc --proxy-type http --proxy proxy.ABCD.com:80 %h %p' -oPort=32 wakao@sftp.ABCD.com


I had the same problem, on Fedora 19, with the following .ssh/config file:

# Outside of the firewall, with HTTPS proxy
Host myhost.hostname.org
ProxyCommand corkscrew proxy 80 %h 443 ~/.ssh/auth.txt
# Inside the firewall (do not use proxy)
Host *
ProxyCommand connect %h %p

I solved just replacing the line

ProxyCommand connect %h %p

with:

ProxyCommand connect-proxy %h %p


I use the following command (Cygwin) for connecting to SFTP servers over SOCKS proxy:

sftp -oProxyCommand='nc -v -x<proxy address>:<port> %h %p' userid@host


Does not looks like there is any .rpm or .deb package that provides /usr/bin/connect - as few answers refer on this page. This has worked for me on Fedora - provided nmap-ncat rpm is installed.

sftp -oProxyCommand='/usr/bin/nc -v -x myproxy.mycompany.com:9999 %h %p' -oPort=6789 sftpUser@sftp.remote.server.com


Just to add to the comments above, if you don't happen to have a friendly SA that will install connect for you, and you have a compiler on your machine, it's dead simple to build connect:

  1. Get the source code from http://www.pontusvision.com/?attachment_id=1316
  2. Compile the code with the following command line:

gcc connect.c -o connect -lresolv -lsocket -lnsl

and then add the newly compiled connect executable to a directory in your path...

and if you have the @ symbol in your user name, you can run the following:

sftp -o "ProxyCommand connect -H proxyuser@proxy.ABCD.com:80 %h %p " -o "User your_remote_sftp_user@email.com" sftp.ABCD.com:32

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜