Score:1

Obtaining "Load key "/root/.ssh/": Is a directory When Executing "ssh -i ~/.ssh root@IP_address

ai flag

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?

Score:1
hr flag

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.

David S avatar
ai flag
Thank you so much! Very much appreciated!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.