I can't create an SFTP target with ppk key

OS info

  • Operating System : Windows 10.0.17763
  • Wappler Version : 2.1.2

I can’t connect with SFTP and create target.
I can ssh to the server with no problems and I can connect through SFTP with WinSCP with no problems also.

The error message is the following:

Testing Connection …

  • set color:use-color yes
  • set cmd:interactive yes
  • set file:charset utf-8
  • set xfer:clobber on
  • set ftp:timezone
  • set cmd:show-status yes
  • set cmd:set-term-status yes
  • set ftp:list-options -a
  • set cmd:fail-exit yes
  • set cmd:time-style “%Y-%m-%d %H:%M:%S”
  • set ftp:ssl-allow no
  • set ssl:verify-certificate no
  • set sftp:auto-confirm yes
  • set sftp:connect-program “ssh -a -x -v -i C:\Users\LeonidasChrisochoou\Downloads\mysite.com
  • set net:max-retries 3
  • set net:timeout 20
  • set net:reconnect-interval-base 5
  • set net:reconnect-interval-multiplier 1
  • open -u user,pass sftp://xxx.xxx.xxx.xxx
  • ls
    ---- Running connect program (ssh -a -x -v -i C:\Users\LeonidasChrisochoou\Downloads*mysite.com* -s -l user xxx.xxx.xxx.xxx sftp)
    —> sending a packet, length=5, type=1(INIT), id=0
    <— Warning: Identity file mysite.com not accessible: No such file or directory.
    <— OpenSSH_7.6p1, OpenSSL 1.0.2m 2 Nov 2017
    <— debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
    <— debug1: Connection established.
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519 type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519-cert type -1
    <— debug1: Local version string SSH-2.0-OpenSSH_7.6
    <— debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
    <— debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
    <— debug1: Authenticating to xxx.xxx.xxx.xxx:22 as ‘user
    <— debug1: SSH2_MSG_KEXINIT sent
    <— debug1: SSH2_MSG_KEXINIT received
    <— debug1: kex: algorithm: curve25519-sha256
    <— debug1: kex: host key algorithm: ecdsa-sha2-nistp256
    <— debug1: kex: server->client cipher: mysite.com MAC: compression: none
    <— debug1: kex: client->server cipher: mysite.com MAC: compression: none
    <— debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    <— debug1: Server host key: ecdsa-sha2-nistp256 SHA256:o3F3bRXiuVSlshjVPwZkkwkQ65+KB4BUOk5py3V2y8Q
    <— debug1: Host ‘xxx.xxx.xxx.xxx’ is known and matches the ECDSA host key.
    <— debug1: Found key in /cygdrive/c/Users/LeonidasChrisochoou/.ssh/known_hosts:1
    <— debug1: rekey after 134217728 blocks
    <— debug1: SSH2_MSG_NEWKEYS sent
    <— debug1: expecting SSH2_MSG_NEWKEYS
    <— debug1: SSH2_MSG_NEWKEYS received
    <— debug1: rekey after 134217728 blocks
    <— debug1: SSH2_MSG_EXT_INFO received
    <— debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-
    sha2-nistp521>
    <— debug1: SSH2_MSG_SERVICE_ACCEPT received
    <— debug1: Authentications that can continue: publickey
    <— debug1: Next authentication method: publickey
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519
    <— debug1: No more authentication methods to try.
    <— user@xxx.xxx.xxx.xxx: Permission denied (publickey).
    **** Peer closed connection
    ---- Disconnecting
    ---- Running connect program (ssh -a -x -v -i C:\Users\LeonidasChrisochoou\Downloads*mysite.com* -s -l user xxx.xxx.xxx.xxx sftp)
    —> sending a packet, length=5, type=1(INIT), id=0
    <— Warning: Identity file mysite.com not accessible: No such file or directory.
    <— OpenSSH_7.6p1, OpenSSL 1.0.2m 2 Nov 2017
    <— debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
    <— debug1: Connection established.
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519 type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519-cert type -1
    <— debug1: Local version string SSH-2.0-OpenSSH_7.6
    <— debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
    <— debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
    <— debug1: Authenticating to xxx.xxx.xxx.xxx:22 as ‘user
    <— debug1: SSH2_MSG_KEXINIT sent
    <— debug1: SSH2_MSG_KEXINIT received
    <— debug1: kex: algorithm: curve25519-sha256
    <— debug1: kex: host key algorithm: ecdsa-sha2-nistp256
    <— debug1: kex: server->client cipher: mysite.com MAC: compression: none
    <— debug1: kex: client->server cipher: mysite.com MAC: compression: none
    <— debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    <— debug1: Server host key: ecdsa-sha2-nistp256 SHA256:o3F3bRXiuVSlshjVPwZkkwkQ65+KB4BUOk5py3V2y8Q
    <— debug1: Host ‘xxx.xxx.xxx.xxx’ is known and matches the ECDSA host key.
    <— debug1: Found key in /cygdrive/c/Users/LeonidasChrisochoou/.ssh/known_hosts:1
    <— debug1: rekey after 134217728 blocks
    <— debug1: SSH2_MSG_NEWKEYS sent
    <— debug1: expecting SSH2_MSG_NEWKEYS
    <— debug1: SSH2_MSG_NEWKEYS received
    <— debug1: rekey after 134217728 blocks
    <— debug1: SSH2_MSG_EXT_INFO received
    <— debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-
    sha2-nistp521>
    <— debug1: SSH2_MSG_SERVICE_ACCEPT received
    <— debug1: Authentications that can continue: publickey
    <— debug1: Next authentication method: publickey
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519
    <— debug1: No more authentication methods to try.
    <— user@xxx.xxx.xxx.xxx: Permission denied (publickey).
    **** Peer closed connection
    ---- Disconnecting
    ---- Running connect program (ssh -a -x -v -i C:\Users\LeonidasChrisochoou\Downloads*mysite.com* -s -l user xxx.xxx.xxx.xxx sftp)
    —> sending a packet, length=5, type=1(INIT), id=0
    <— Warning: Identity file mysite.com not accessible: No such file or directory.
    <— OpenSSH_7.6p1, OpenSSL 1.0.2m 2 Nov 2017
    <— debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
    <— debug1: Connection established.
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa-cert type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519 type -1
    <— debug1: key_load_public: No such file or directory
    <— debug1: identity file /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519-cert type -1
    <— debug1: Local version string SSH-2.0-OpenSSH_7.6
    <— debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
    <— debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
    <— debug1: Authenticating to xxx.xxx.xxx.xxx:22 as ‘user
    <— debug1: SSH2_MSG_KEXINIT sent
    <— debug1: SSH2_MSG_KEXINIT received
    <— debug1: kex: algorithm: curve25519-sha256
    <— debug1: kex: host key algorithm: ecdsa-sha2-nistp256
    <— debug1: kex: server->client cipher: mysite.com MAC: compression: none
    <— debug1: kex: client->server cipher: mysite.com MAC: compression: none
    <— debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    <— debug1: Server host key: ecdsa-sha2-nistp256 SHA256:o3F3bRXiuVSlshjVPwZkkwkQ65+KB4BUOk5py3V2y8Q
    <— debug1: Host ‘xxx.xxx.xxx.xxx’ is known and matches the ECDSA host key.
    <— debug1: Found key in /cygdrive/c/Users/LeonidasChrisochoou/.ssh/known_hosts:1
    <— debug1: rekey after 134217728 blocks
    <— debug1: SSH2_MSG_NEWKEYS sent
    <— debug1: expecting SSH2_MSG_NEWKEYS
    <— debug1: SSH2_MSG_NEWKEYS received
    <— debug1: rekey after 134217728 blocks
    <— debug1: SSH2_MSG_EXT_INFO received
    <— debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-
    sha2-nistp521>
    <— debug1: SSH2_MSG_SERVICE_ACCEPT received
    <— debug1: Authentications that can continue: publickey
    <— debug1: Next authentication method: publickey
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_rsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_dsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ecdsa
    <— debug1: Trying private key: /cygdrive/c/Users/LeonidasChrisochoou/.ssh/id_ed25519
    <— debug1: No more authentication methods to try.
    <— user@xxx.xxx.xxx.xxx: Permission denied (publickey).
    **** Peer closed connection
    ---- Disconnecting
    ls: Fatal error: max-retries exceeded (user@xxx.xxx.xxx.xxx: Permission denied (publickey).)

Any ideas ?
Thank you in advance.

Hi Leonidas - welcome to Wappler!

Did you enter your SSH key? And what file format is it / what extension does it have?

Hi George,

Yes, I have entered the SSH key.
The key has the .ppk extension.

That is the problem than. You need to convert the ppk key first, see:

OK it worked.

Thank you George

1 Like

I had to change the path to my ppk file to /cygdrive/C/Users/ instead of file:////C:/Users/, which was populated by the file picker, in order to get the connection to my Linux server working.
It’s also very unclear that the password field is used to unlock the ppk.
Integration with an SSH key agent like Putty agent or the native Windows 10 ssh-agent would be more convenient.

I still don’t understand the meaning or function of the “Use active” toggle.

I’m using Wappler 2.4.5 on Windows 10.1909.

Regards,
Barry

Good one - we will have this checked.

Well this is if the FTP server works with “Active” or “Passive” connections, see:

1 Like

Thanks George for clearing that up! It has been a while since I used plain FTP, but I remember the difference :wink:
Should I create a “Bug” post for the file picker issue?

Yes please do so we can track it better