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

8,976

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.

Share:
8,976

Related videos on Youtube

Chaitanya Bapat
Author by

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, 2022

Comments

  • Chaitanya Bapat
    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
      Toto about 6 years
      And what is the error?
  • JannieT
    JannieT over 5 years
    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?
  • Chaitanya Bapat
    Chaitanya Bapat over 5 years
    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"?
  • JannieT
    JannieT over 5 years
    yes. That is exactly what I mean.
  • Chaitanya Bapat
    Chaitanya Bapat over 5 years
    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
    Chaitanya Bapat over 5 years
    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?
  • JannieT
    JannieT over 5 years
    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.
  • Chaitanya Bapat
    Chaitanya Bapat over 5 years
    Alright.. makes sense!