On Wed, Jul 24, 2024 at 7:09 AM Bharath Seshagiri (EXT-Nokia) via curl-library <curl-library@lists.haxx.se> wrote: > > When I try to sftp upload through curl executable I am getting following > errors. Keys are configured properly and curl sftp fails with Failure > establishing ssh session: -44, Unable to ask for ssh-userauth service error. > > Below is the curl version which has been installed. > > curl 7.82.0 (aarch64-poky-linux-gnu) libcurl/7.82.0 GnuTLS/3.7.1 > (OpenSSL/3.0.7) zlib/1.2.11 libidn2/2.3.0 libssh2/1.9.0 > > Release-Date: 2022-03-05 > > Protocols: dict file ftp ftps gopher gophers http https imap imaps pop3 pop3s > rtsp scp sftp smb smbs smtp smtps telnet tftp > > Features: alt-svc AsynchDNS Debug HSTS HTTPS-proxy IDN IPv6 Largefile libz > MultiSSL NTLM SSL TLS-SRP UnixSockets > > root@5GSM-SRC234610033:/etc/ssh# curl -vv -u ftpuser: --key > /etc/sftpkeys/id_dsa --pubkey /etc/sftpkeys/id_dsa.pub -T //var/tmp/file.txt > sftp://ftpuser@[2a00:8a03:190::6:6]//home/ftpuser/file.txt -k > > * STATE: INIT => CONNECT handle 0xaaaabdfd9920; line 1834 (connection #-5000) > > * Added connection 0. The cache now contains 1 members > > * family0 == v6, family1 == v4 > > * Trying 2a00:8a03:190::6:6:22... > > * STATE: CONNECT => CONNECTING handle 0xaaaabdfd9920; line 1895 (connection > #0) > > % 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 2a00:8a03:190::6:6 (2a00:8a03:190::6:6) port 22 (#0) > > * STATE: CONNECTING => PROTOCONNECT handle 0xaaaabdfd9920; line 2027 > (connection #0) > > * SFTP 0xaaaabdfd8bc8 state change from SSH_STOP to SSH_INIT > > * SFTP 0xaaaabdfd8bc8 state change from SSH_INIT to SSH_S_STARTUP > > * STATE: PROTOCONNECT => PROTOCONNECTING handle 0xaaaabdfd9920; line 2047 > (connection #0) > > * Failure establishing ssh session: -44, Unable to ask for ssh-userauth > service > > * SFTP 0xaaaabdfd8bc8 state change from SSH_S_STARTUP to SSH_SESSION_FREE > > * SFTP 0xaaaabdfd8bc8 state change from SSH_SESSION_FREE to SSH_STOP > > * multi_done: status: 2 prem: 1 done: 0 > > 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 > > 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 > > * The cache now contains 0 members > > * SSH DISCONNECT starts now > > * SSH DISCONNECT is done > > * Closing connection 0 > > * Expire cleared (transfer 0xaaaabdfd9920) > > curl: (2) Failure establishing ssh session: -44, Unable to ask for > ssh-userauth service >
Hmmm... > --key /etc/sftpkeys/id_dsa DSA was deprecated in SSH a decade ago. See the changelog for OpenSSH 6.5/6.5p1 (2014-01-30). You should try a connection to the server using the DSA key and the sftp command. Transfer a dummy file, like: sftp test.txt ftpuser@\[2a00:8a03:190::6:6\]:ftpuser Jeff -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html