cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: ssh custom port

From: Ray Satiro via curl-users <curl-users_at_cool.haxx.se>
Date: Sat, 16 Jul 2016 00:07:14 -0400

On 7/15/2016 12:19 AM, el kalin wrote:
> so... no?! no ideas?
>
> On Thu, Jul 14, 2016 at 1:47 PM, el kalin <kalin_at_el.net
> <mailto:kalin_at_el.net>> wrote:
>
>
>
> hi all...
>
> i have been asked to send files to a remote machine via sftp using
> a non standard ssh port.
>
> the sftp tool has the option -oPort that allows for a non standard
> port to be used for the ssh hookup.
> i've used curl many times to scrip sftp transfers but can't figure
> out how to tell curl to use a port other than 22 for an sftp
> transfer...
>
> i keep getting:
>
> * About to connect() to remote.host.com <http://remote.host.com>
> port 10022 (#0)
> * Trying 12.34.56.78... connected
> * Connected to remote.host.com
> <http://remote.host.com> (12.34.56.78) port 10022 (#0)
> * Failure establishing ssh session
> * Closing connection #0
>
> curl: (2) Failure establishing ssh session
>
> i tried pretty much any option including
> sftp://remote.host.com:10022...
>
> i know it works with sftp -oPort=10022 but i can't script sftp.
> what's the equivalent of that in curl?
>
> any ideas welcomed...
>
> thanks..
>

The other replies are right, there is some problem connecting to the
server. You have the right format.

curl -T filetoupload -u username:password sftp://hostname:port

See more examples in the manual https://curl.haxx.se/docs/manual.html

What version of curl are you using? curl -V.

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-07-16