<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof"><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Hi all, </span></div>
<div class="elementToProof"><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">Hi, I need some help.
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">I have configured an instance with squid as a proxy service. HTTP/HTTPS requests pass through the proxy correctly.</div>
<div class="ContentPasted0"><br>
</div>
<div class="ContentPasted0"><span style="font-family:monospace"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">acl</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"> Safe_ports
</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">port</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">9122</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">        </span><br>
</span></div>
<div class="ContentPasted0"><span style="font-family:monospace"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">acl</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"> SSL_ports
</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">port</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">9122</span><span style="color:#000000;background-color:#ffffff"></span><br>
<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">acl</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"> Safe_ports
</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">port</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">22</span><span style="color:#000000;background-color:#ffffff"></span><br>
</span></div>
<div class="ContentPasted0"><span style="font-family:monospace"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">acl</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"> SSL_ports
</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">port</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">22<br>
</span><br>
<br>
</span></div>
<div class="ContentPasted0">But I need to connect to an SFTP service that listens on port 9122.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">On the squid configuration side I have added port 9122 to the secure ports and the connection host to the hosts allowed in the dstdomain.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">I have created the environment variables necessary to be able to exit through the proxy:</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">http_proxy=http://myprox.prod:3142</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">ftp_proxy=http://myproxy.prod:3142</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">https_proxy=http://myproxy.prod:3142</div>
<div><br class="ContentPasted0">
</div>
<div>i try the connection but never happen</div>
<div><br>
</div>
<div class="ContentPasted0"><span style="font-family:monospace" class="ContentPasted1"><span style="color:#000000;background-color:#ffffff" class="ContentPasted1">sftp -v -oProxyCommand='nc -v -xtheprovider-front.prod:3142 %h %p' -oPort=9122 user@sftp.server.com</span><br class="ContentPasted1">
</span></div>
<div class="ContentPasted0"><span style="font-family:monospace" class="ContentPasted1">OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016
<br class="ContentPasted1">
debug1: Reading configuration data /etc/ssh/ssh_config <br class="ContentPasted1">
debug1: /etc/ssh/ssh_config line 18: Applying options for * <br class="ContentPasted1">
debug1: Executing proxy command: exec nc -v -xtheprovider front.prod:3142 <span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted2">sftp.server.com</span> 9122
<br class="ContentPasted1">
debug1: permanently_set_uid: 0/0 <br class="ContentPasted1">
debug1: permanently_drop_suid: 0 <br class="ContentPasted1">
debug1: key_load_public: No such file or directory <br class="ContentPasted1">
debug1: identity file /root/.ssh/id_rsa type -1 <br class="ContentPasted1">
debug1: key_load_public: No such file or directory <br class="ContentPasted1">
debug1: identity file /root/.ssh/id_rsa-cert type -1 <br class="ContentPasted1">
debug1: key_load_public: No such file or directory <br class="ContentPasted1">
debug1: identity file /root/.ssh/id_dsa type -1 <br class="ContentPasted1">
debug1: key_load_public: No such file or directory <br class="ContentPasted1">
debug1: identity file /root/.ssh/id_dsa-cert type -1 <br class="ContentPasted1">
debug1: key_load_public: No such file or directory <br class="ContentPasted1">
debug1: identity file /root/.ssh/id_ecdsa type -1 <br class="ContentPasted1">
debug1: key_load_public: No such file or directory <br class="ContentPasted1">
debug1: identity file /root/.ssh/id_ecdsa-cert type -1 <br class="ContentPasted1">
debug1: key_load_public: No such file or directory <br class="ContentPasted1">
debug1: identity file /root/.ssh/id_ed25519 type -1 <br class="ContentPasted1">
debug1: key_load_public: No such file or directory <br class="ContentPasted1">
debug1: identity file /root/.ssh/id_ed25519-cert type -1 <br class="ContentPasted1">
debug1: Enabling compatibility mode for protocol 2.0 <br class="ContentPasted1">
debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3 <br class="ContentPasted1">
<br class="ContentPasted1">
</span><br>
</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">#### squid logs</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">1674134582.904      0 172.31.29.227 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -<br>
</div>
<div class="ContentPasted0"><br>
</div>
<div class="ContentPasted0"><br>
</div>
Any help?<br>
</span></div>
</body>
</html>