Could not load key file. File 'id_rsa.pub' could not be loaded or does not contain a private key. - File Zilla
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.
Related videos on Youtube
Chaitanya Bapat
Current - SDE @ FB Previously - Amazon AWS. Apache MXNet Committer. Coding enthusiast, passionate about learning new languages. Intent on mastering data sciences along with databases (handy knowledge of Relational and Object oriented databases) Music fanatic, Cricket and football fan (Chelsea) Spanish learner!
Updated on September 18, 2022Comments
-
Chaitanya Bapat over 1 year
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
-
Toto about 6 yearsAnd what is the error?
-
-
JannieT over 5 yearsI 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?
-
Chaitanya Bapat over 5 yearsDo 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"?
-
JannieT over 5 yearsyes. That is exactly what I mean.
-
Chaitanya Bapat over 5 yearsI 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 over 5 yearsThis 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?
-
JannieT over 5 yearsNot 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. -
Chaitanya Bapat over 5 yearsAlright.. makes sense!