SFTP Public key authentication failure: Invalid PEM structure, ----BEGIN..... missing?

FTP client for Android handsets.
Post Reply
apska
Posts: 1
Joined: Sun Jan 17, 2021 1:47 pm
AntiSpam sum: 8

SFTP Public key authentication failure: Invalid PEM structure, ----BEGIN..... missing?

Post by apska »

Hi Support,

I have been using AndFTP for many years for syncing data from my mobile phone to my Ubuntu server. Also public key authentication has worked, at least with the free version. Now I'm running AndFTP 5.4 Pro version and a new server instance. I have an issue with SFTP and public key authentication.

Attempting to connect using SFTP with custom SSH port 2222. Server (Ubuntu 20.04) does not allow password logins. I have created a pair of RSA keys with ssh-keygen. Public key has been added to the server authorized_keys. Private key available in the mobile device.

Thus AndFTP settings look like this:
settings_general.png
settings_advanced.png
When trying to connect, I get error saying Publickey authentication failed. java.io.IOException: Invalid PEM structure, '-----BEGIN...' missing
connect_error_message.png
The key file starts with

Code: Select all

-----BEGIN OPENSSH PRIVATE KEY-----
and definitely seems correct to me.

Could you please check if it should be possible to connect with these conditions? Thanks!

AndFTP 5.4 Pro
Android 10 on Nokia 8.1 TA-1119

Post Reply