I don't want to login automatically to ssh agent, but only effective execute simple script in 'sh' file:
#!/bin/bash
clear
echo " >> Start the ssh-agent in the background."
eval $(ssh-agent -s)
echo " >> Add SSH private key to the ssh-agent"
ssh-add ~/.ssh/id_rsa
echo " >> List of ssh agents"
ssh-add -l
echo " >> Attempts ssh to GitHub"
ssh -T git@github.com
it does trigger the password request and does wait for it to be entered, even not in home dir. git inform that 'Identity added:' and 'You've successfully authenticated'
but the problem is after try to communicate with Github - 'git push' or 'pull' command does not take any positive effect :
sign_and_send_pubkey: signing failed: agent refused operation
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
after that issue I can type from keyboard the same commands ex.
ssh-add ~/.ssh/id_rsa
enter passphrase and then it enables me successfully communication with Github. What's wrong in the above script?
My context:
OS name: "linux", version: "4.15.0-76-generic", arch: "amd64", family: "unix"