Search code examples
gitgithubssh-keysgit-bashgit-clone

Warning of RSA host key while cloning git repository


I am using git bash to clone my github repository and getting warning continuously I am using SSH so, I use this git command: git clone [email protected]:TapanHP/HTextView but it gives warning like this

Warning: Permenantly added the RSA host key for IP address to the list of known hosts

Enter passphrase for key 'c/users/tapanhp/.ssh/id_rsa':

what is this passphrase? and why this happens?


Solution

  • The SSH connection to GitHub uses RSA, a form public key cryptography. This means that you have a private key and a public key. You give others your public key (in this case, GitHub), and use your private key to encrypt data. They can then decrypt the data using your public key, which will only decrypt information that was encrypted with your private key. As long as no one else has your private key, they can't pretend to be you.

    In practical terms, you presumably have the files c/users/tapanhp/.ssh/id_rsa and c/users/tapanhp/.ssh/id_rsa.pub.

    id_rsa.pub is your public key, and id_rsa is your private key. To help keep it private, whoever generated it chose a passphrase to encrypt it with. That is the passphrase that is being asked for.

    If you generated this key pair, then it is whatever you chose. If someone else did, then it is whatever they chose.

    If no one knows the passphrase, you will have to generate a new key pair and give GitHub the new public key.

    GitHub provides a nice guide for doing this: https://help.github.com/articles/generating-an-ssh-key/

    The warning message is just telling you that it is associating the IP address of GitHub's SSH server with their encryption key. This is done to help prevent man-in-the-middle attacks.