ytrewq
ytrewq

Reputation: 3930

ssh: id_rsa not accessible - how do I get it?

I'm trying to make a ssh connection to a server with the following command,

ssh -v -i ~/.ssh/id_rsa -p 12345 [email protected]

Debugging shows that permission was denied because id_rsa was not accessible, and in fact I don't have the file.

I'm not familiar with this id_rsa file.. Is this something I should request and receive from the server maintainer? Or is there a way to generate it?

Upvotes: 0

Views: 4097

Answers (1)

trnelson
trnelson

Reputation: 2773

You would need to generate an SSH key pair on your computer. This will generate both a public and private key. The public key (denoted by a .pub) extension will need to be added to the server you are connecting to, normally in the ~/.ssh/authorized_keys file, or via some web interface in the case of services like GitHub. The private key remains on your computer and is used in place of the id_rsa key you noted above within the -i switch.

You will be given the option to add a password and also to select a name for the key pair.

ssh-keygen -t rsa -C "[email protected]"

More information can be found here (GitHub article, but not necessarily specific to GitHub): GitHub: Generating SSH Keys

Upvotes: 1

Related Questions