Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proxy Details with SFTP command

Tags:

sftp

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 combinations 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"   [email protected]:32
sftp -o "ProxyCommand  connect -S proxy.ABCD.com:80    %h    %p"  [email protected]:32

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

like image 542
Sandeep Avatar asked Jul 26 '10 10:07

Sandeep


People also ask

Can SFTP use a proxy?

To make SFTP work through an Explicit proxy, do the following: Intercept the Explicit service (example 8080) and disable Detect Protocol. Ensure your policy is set to Allow.

What is the SFTP command?

SFTP (Safe File Transfer Protocol) is part of the SSH protocol designed to securely transfer files between remote systems. It allows users to view, manage, and change file and directory permissions on remote systems.

How do I test my SFTP connection?

You use a test file to test the SFTP connection and the web server. Use a command line SFTP tool available from a third-party source. For example, PuTTY SFTP client (PSFTP) works well for this test. Note: There are several PuTTY applications for download, but only PSFTP works for this test.


2 Answers

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 [email protected]
like image 116
André Fernandes Avatar answered Oct 14 '22 23:10

André Fernandes


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" [email protected]
like image 36
Sandeep Avatar answered Oct 14 '22 23:10

Sandeep