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:

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.

  1. mkdir ~/.ssh
  2. vim known_hosts – if you already have known_hosts, skip this.
  3. ssh-keyscan -t rsa >> ~/.ssh/known_hosts
  4. ssh-keygen -t rsa -C ""
  5. Add the key to SSH keys list on your GitHub profile.

Set up your client

  1. Generate your key
    • ssh-keygen
  2. Configure ssh to use the key
    • vim ~/.ssh/config
  3. Copy your key to your server
    • ssh-copy-id -i /path/to/ SERVERNAME

Your config file from step 2 should have something similar to the following:

Hostname ip-or-domain-of-server
PubKeyAuthentication yes
IdentityFile ./path/to/key

eval “$(ssh-agent -s)”

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s