Proxy Server and SFTP routing

Hi Friends,

I am trying to connect to remote server via proxy server and transfer files from my server .

the proxy server is windows.

I wanted to know is that is it possible?

I am using command to connect is

/usr/local/bin/sftp -o "ProxyCommand nc proxyserver.com 8080"(E-Mail address blocked: See forum rules) 22

Could some one tell me whether above command is valid?

Could someone please share the command to connect to remote server via proxy?

Thanks,
Reddy

Check out the info on these links:
General :: How To Sftp Using A SOCKS V5 Proxy
how to sftp using a SOCKS v5 proxy
unix - How do I connect to a server behind an socks5 proxy through SSH on mac/linux? - Server Fault
https://kb.bluecoat.com/index?page=content&id=FAQ1397&actp=RSS

1 Like

Hi Spacebar,

Thanks for your quick reply!!!

I got the below command and ran

/usr/local/bin/sftp -oIdentityFile=/x0/xxxxx/yyyyy/.ssh/key_name -o "ProxyCommand nc proxy.server.com 8080 %h %p" user@remoteserver.com 22

When I run this command from server xyz via proxy server proxy.server.com to remote server remoteserver.com I am getting message

Connecting to remoteserver.com.... and prompt never comes back and no connection being made to remote server.

DO you think the command I am using is incorrect way?

Thanks,
Reddy

Try it like this, I've also added the "-v" switches so you should get more verbage of what is happening:

sftp -v -oIdentityFile=/x0/xxxxx/yyyyy/.ssh/key_name -oProxyCommand='/usr/bin/nc -v -xproxy.server.com:1080 %h %p' user@remote_sftp_server.com 22

Hi Spacebar

I ran below command

/usr/local/bin/sftp -v -oIdentityFile=/x0/xxxxx/yyyyy/.ssh/key_name -oProxyCommand="/usr/bin/nc -v proxy.server.com 8080 %h %p" user@remote_sftp_server.com 22

Connecting to remote_sftp_server.com...
OpenSSH_4.5p1, OpenSSL 0.9.8d 28 Sep 2006
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Executing proxy command: exec /usr/bin/nc -v proxy.server.com 8080 remote_sftp_server.com 22
debug1: permanently_drop_suid: 620026
debug1: identity file /x0/xxxxx/yyyyy/.ssh/key_name type -1
proxy.server.com [XXX.XX.XXX.XX] 8080 (?) open

Once again thanks alot for you help!!!

Dear All, I apologize for putting my server issue in existing thread, but my issue is same and bit urgent. I appreciate if you guys can help.

Hello Experts,

I need an urgent help. I have to make sftp connection to the remote server where I have to put and get files. Using "put" and "get".

But I am unable to login to sftp site on internet from my local server.

Please help

---------- Post updated at 09:47 AM ---------- Previous update was at 06:54 AM ----------

Little improvement,,..after giving docket address, the error changed

[root@test1 ~]# sftp -o "ProxyCommand /usr/bin/nc -X connect 10.105.54.134:8080 %h %p" User@files12.server.net 22

Please suggest!!! It is really critical.

Try it like this and post the additional messages logged:

sftp -v -oProxyCommand='/usr/bin/nc -v -x10.105.54.134:8080 %h %p' User@files12.server.net 22