Issue
I've never experienced it before. So, please bear with me.
I have generated a RSA ssh key. I checked it by following.
ssh-agent -s
Output
------
SSH_AUTH_SOCK=/tmp/ssh-<12chars-key>/agent.<5-digit no>; export SSH_AUTH_SOCK;
SSH_AGENT_PID=<5-digit no>; export SSH_AGENT_PID;
echo Agent pid <5-digit no>;
ssh-add ~/.ssh/id_rsa
I run the above command and added the identity from .ssh/id_rsa
private key.
I'm on an ubuntu.
When I clone from github using this ssh public key, I can. But from other remote machine using ip address, I can't and output the following error.
Cloning into 'myreponame'...
myusername@<ip address>: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
I used following command.
git clone git+ssh://<ip ADDRESS>/PATH/TO/GIT/REPO
Thank you for your help.
Solution
Now working!
The correct command to use is
git clone ssh://git@<ip address>/PATH/TO/REMOTE/REPO
Answered By - Htet Phyo Naing Answer Checked By - Clifford M. (WPSolving Volunteer)