buon pomeriggio, devo sviluppare un applicazione che si connette ad un server SFTP e scarica un file, chi gestisce il server remoto mi ha fornito i seguenti parametri:
username,host,port
e mi chiede di generare (e comunicare loro) una chiave pubblica.
E’ la prima volta che uso un SFTP e vorrei utilizzare il plugin CURLMBS che ho licenziato. Non ho per idea su come avverr l’autenticazione.
Qualcuno pu darmi una dritta?
ok, ho creato con putty le due chiavi come consigliato da massimo
adesso ho due file, la chiave pubblica l’ho comunicata a chi mi espone il server Sftp e quella privata l’ho messa nella configurazione di Filezilla.
Usando FZ Client funziona perfettamente, in Xojo, come imposto la chiave privata nella chiamata Curl?
PS la chiave privata un file id-rsa.ppk, devo copiarne il contenuto in qualche variabile???
I’m sure my paths are correct, tried your example but I get:
Rebuilt URL to: sftp://filetransfer.plugandpay.it:22/
Trying 77.43.5.170...
Connected to filetransfer.plugandpay.it (77.43.5.170) port 22 (#0)
SSH MD5 fingerprint: 9d813bffa6748adaa07a474a45941cb8
SSH authentication methods available: password,publickey,keyboard-interactive
Using SSH public key file 'C:\\Users\\c.marciano.NCS\\.ssh\\id_rsa.pub'
Using SSH private key file 'C:\\Users\\c.marciano.NCS\\.ssh\\id_rsa'
SSH public key authentication failed: Username/PublicKey combination invalid
Failure connecting to agent
Authentication failure
Closing connection 0
so the correct paths are:
Using SSH public key file ‘C:\Users\c.marciano.NCS\.ssh\id_rsa’
Using SSH private key file ‘C:\Users\c.marciano.NCS\.ssh\id_rsa.ppk’
I see that puttygen.exe set 2048 as number of bits in a generated key
You did specify the user name?
you are sure it’s correct?
What does log from other app shows?
Alternatively you could use username/password instead of public keys.[/quote]
Hi Christian!
using your suggested paths I get that error, using mine the problem is:
SSH public key authentication failed: Invalid key data, not base64 encoded
the difference beetween your paths and mine is here
YOURS
Using SSH public key file ‘C:\Users\c.marciano.NCS\.ssh\id_rsa.pub’
Using SSH private key file ‘C:\Users\c.marciano.NCS\.ssh\id_rsa’
MINE
Using SSH public key file ‘C:\Users\c.marciano.NCS\.ssh\id_rsa’
Using SSH private key file ‘C:\Users\c.marciano.NCS\.ssh\id_rsa.ppk’
I cannot use username/password authetication…
please note that the same couple of keys (mine) in Filezilla works
[quote=427193:@Christian Schmitz]“Invalid key data, not base64 encoded”.
What key data do you have?
Maybe you have DER (binary) format and need to convert to PEM format?[/quote]
I’ve used puttygen with standard options to generate the keys following this: