cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: ssh custom port

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 18 Jul 2016 21:39:29 +0200

On Mon, Jul 18, 2016 at 03:22:20PM -0400, el kalin wrote:
> so here is what happens now with curl 7.49.1:
>
> # curl -vvvv -T test.txt -u user:pass --insecure sftp://remote.host.com:10022/
> upload/
>
> *   Trying 12.34.56.78...
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*
> Connected to remote.host.com (12.34.56.78) port 10022 (#0)
> * SSH MD5 fingerprint: 1efeb85083b9658438c17f603fa8c5e0
> * SSH authentication methods available: publickey,password,keyboard-interactive
> * Using SSH private key file ''
> * SSH public key authentication failed: Unable to extract public key from
> private key file: Unable to open private key file
> * Initialized password authentication
> * Authentication complete
> * Upload failed: No such file or directory (2/-31)
>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
> * Connection #0 to host remote.host.com left intact
> curl: (78) Upload failed: No such file or directory (2/-31)
>
>
> but the directory is there i can clearly see it when sftp in and can put files
> there too... 

The URL sftp://host/upload/ means to upload the file to the remote host with
the name "~/upload/". You probably want to use the URL
sftp://host/upload/test.txt

> # sftp -oPort=10022 user_at_remote.host.com
> Connecting to remote.host.com...
> user_at_remote.host.com's password: 
> sftp> cd upload
> sftp> put test.txt
> Uploading test.txt to /home/user/upload/test.txt
> test.txt                                                                      
>                                                                                
>                                              100%    0     0.0KB/s   00:00    
> sftp> ls -al
> drwxr-xr-x    1 user  None            0 Jul 18 15:17 .
> -rw-r--r--    1 user  None            0 Jul 18 15:17 test.txt
> sftp> 
>
>
>  i'm using --insecure cause i was getting:
>
> curl: (51) SSL peer certificate or SSH remote key was not OK

There's probably a bad entry in ~/.ssh/known_hosts

>>> Dan
-------------------------------------------------------------------
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-18