Could not load key file. File 'id_rsa.pub' could not be loaded or does not contain a private key. - File Zilla

0

1

While trying to connect to AWS instance using SFTP, it gives me an error while setting the ~/.ssh/id_rsa.pub file for connection.

Error - Could not load key file. File 'id_rsa.pub' could not be loaded or does not contain a private key. - File Zilla

Chaitanya Bapat

Posted 2018-04-03T11:49:17.793

Reputation: 113

And what is the error? – Toto – 2018-04-03T11:55:46.910

Answers

1

Realized that it needed a private file (key) to be given for setting up SFTP connection. ~/.ssh/id_rsa is the private file ~/.ssh/id_rsa.pub is the public file One has to use the private file for FileZilla to connect.

Chaitanya Bapat

Posted 2018-04-03T11:49:17.793

Reputation: 113

I have an active ~/.ssh/id_rsa private key file that I use to ssh into my server, but I get this same error message when I try to set this in FileZilla. Any idea what the problem is? – JannieT – 2018-10-23T13:37:59.277

Do you mean it says "Could not load key file. File 'id_rsa' could not be loaded or does not contain a private key. - File Zilla"? – Chaitanya Bapat – 2018-10-23T20:22:58.227

yes. That is exactly what I mean. – JannieT – 2018-10-24T09:45:32.543

This is very weird coz id_rsa is the private key file and only possible explanation is that it might be corrupt for some reason. Can you try downloading the pem file or creating a new pem file and using that? – Chaitanya Bapat – 2018-10-24T23:29:01.053

Not so. If my private id-rsa file was corrupt then I would not be able to use it many times every day to ssh into several servers. But heh, I'm just reporting what I am experiencing, not trying to explain the problem. If someone has a similar problem as me, then try my answer below. – JannieT – 2018-10-25T08:38:07.983

Alright.. makes sense! – Chaitanya Bapat – 2018-10-26T23:58:41.610

0

On MacOS FileZilla wouldn't accept my active private key stored at ~/.ssh/id_rsa, but when I set the Logon Type to Interactive I could connect without a password.

JannieT

Posted 2018-04-03T11:49:17.793

Reputation: 981

I use MacOS and FileZilla does accept private key. More importantly, to connect to AWS you ideally should need a pem file (from security standpoint) – Chaitanya Bapat – 2018-10-24T23:27:57.960