1

I am attempting to log into an instance I created in the IBM cloud.

When I attempt to execute the command "ssh -i ~/.ssh root@[IP_address of my instance], I receive the error "Load key "/root/.ssh/": Is a directory root@[IP_address of my instance]'s password:

Prior to executing this command, I did run ssh-keygen and was able to generate new set of files i.e., id_rsa and id_rsa.pub.

I have run the chmod 700 on the 2 files id_rsa and id_rsa.pub but this appears to not have worked.

Can someone help me understand why the command above i.e., "ssh -i ~/.ssh root@[IP_address of my instance] results in this error?

1 Answer 1

1

The -i option requires the name of the private key file, not the name of the directory containing the file:

ssh -i ~/.ssh/id_rsa root@[IP_address of my instance]

However, since ~/.ssh/id_rsa is the default RSA key file, you can omit the -i option and its argument altogether

ssh root@[IP_address of my instance]

Of course, for the authentication to succeed you will need to have copied the public key to the authorized_keys file on the remote account - using ssh-copy-id or otherwise.

1
  • Thank you so much! Very much appreciated!
    – David S
    Jul 2, 2021 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.