how to designate a private key file is to be used?
I've beaten around a problem all day long. I'd bet one of you knows the answer to this off the top of their head.
Mission is to use O2+ as a git client with BitBucket at the back end. Almost everything is there, but missing one piece.
Have a key pair generated with the public key sent up to BitBucket. From the O2+ was able to demonstrate the key exchange works by designating the (private) key file in a ssh attempt (ssh -i privatekeyfilename firstname.lastname@example.org). The keys are in place.
Using git in attempt to clone a repository fails with BitBucket implicating the public key unavailable. The failure is true, but I believe the message is actually incorrect. Recall above I've validated they key exchange. What I'm sure is happening is the O2+ hasn't been adequately provisioned to use the private key when git makes the attempt.
I seem to be missing something analogous to ssh-agent, but in the OpenWRT world. How do i tell the system it should use the key file in the O2+?
So here is how you do it.
I am assuming that you have your key stored at /root/.ssh/id_rsa with proper chmod 600 permissions.
make sure you have installed these as well.
opkg install git-http opkg install ca-bundle
then do this, to configure git to use your key.
git config core.sshCommand 'ssh -i /root/.ssh/id_rsa'
that should do it.
Thanks for the update!
The private key file has a different name, packages were installed, permissions were correct. Ashamedly I must admit I realized it was perhaps a git config issue after hours of flailing and minutes of posting the issue. In the office in the AM I'll address it as a simple "git config" issue.
I'm sure you nailed it!
You did indeed nail it.
My error was I was working so much in the ssh world for a few hours that it didn't occur to me until late that this was not an OS issue but an application issue. Setting up key pairs, no matter how many times I've done it, is so damn error prone that a repetitive motion disorder takes over.
I would add for others making this trip that a global change may benefit them. In my case the actual command was:
git config --global core.sshCommand "ssh -i /root/.ssh/id_omega255f.pem"
I had expected to see a /etc/git/ directory get created with a config file for the global change. Not so....apparently done somewhere else. Maybe some day (like later today) I'll need to find it. 8^o