A problem occurred while I `git push` to my git server on ec2.
I handled this by following this three guide of which their original links are:
http://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository
https://chenhuachao.com/2016/05/26/ssh%E5%87%BA%E9%94%99-sign-and-send-pubkey-signing-failed-agent-refused-operation/
Sorry for missing out the second source link, I will add that later.
sign_and_send_pubkey: signing failed: agent refused operation
Permission denied (publickey).
fatal: Could not read from remote repository.
mkdir ~/.ssh
vim known_hosts
– if you already have known_hosts, skip this.ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
ssh-keygen -t rsa -C "user.email"
- Add the id_rsa.pub key to SSH keys list on your GitHub profile.
Table of Contents
Set up your client
- Generate your key
ssh-keygen
- Configure ssh to use the key
vim ~/.ssh/config
- Copy your key to your server
ssh-copy-id -i /path/to/key.pub SERVERNAME
Your config file from step 2 should have something similar to the following:
Host SERVERNAME
Hostname ip-or-domain-of-server
User USERNAME
PubKeyAuthentication yes
IdentityFile ./path/to/key
eval “$(ssh-agent -s)”
ssh-add