cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: ssh custom port

From: el kalin <kalin_at_el.net>
Date: Mon, 18 Jul 2016 17:57:03 -0400

sorry.... i didn't see the first part of your reply...

i tried that too... the sftp://host/upload/test.txt part:

# curl -vvvv -T test.txt -u user:pass --insecure sftp://
remote.host.com:10022/upload/test.txt
* Trying 12.23.34.56...
  % 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.23.34.56) port 10022 (#0)
* SSH MD5 fingerprint: 1efeb85083b9658438c17f603fa8c5e0
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
  0* 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)

about the second part - the known_hosts. there is nothing there until i use
the sftp. but doesn't matter if it's before or after I was always
getting SSL peer certificate or SSH remote key was not OK..

i did check and recheck many times - and in the previous example i show how
i use sftp to login and put the file too... i don't see any other
directories or paths. it's only upload....

according to the curl manual error 78 is CURLE_REMOTE_FILE_NOT_FOUND. i
can't see how is that true unless it takes in consideration the port in
sftp://remote.host.com:10022/upload/test.txt. but that'd be weird...

thanks...

On Mon, Jul 18, 2016 at 3:39 PM, Dan Fandrich <dan_at_coneharvesters.com>
wrote:

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

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