Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)

Upon generating ssh-keys to github account, I create a new file to hold the keys as:

  ssh-keygen  -f ~/.ssh/github 

Then do the following steps:

eval $(ssh-agent -s)

ssh-add ~/.ssh/github

Add the public key to GitHub account.

However, after restarting the machine, it prompts that I have not accessed to the private repo,

I have to repeat

eval $(ssh-agent -s)

ssh-add ~/.ssh/github

to gain access to the repository.

Every time, I re-login a terminal, the above steps should be repeated.

How could solve the problem?

1 Answer

0 votes
by (12.4k points)
edited by

.bash_profile or .profile is read by login shells, along with .bashrc; subshells read only .bashrc

Just make sure that your SSh key is working "ssh -i /path/to/private/key [email protected]" as the new version of Git uses the new OpenSSH format.

For more, you can read here

Are you interested in knowing more about DevOps and its Tools? Come & join: DevOps Certification

Browse Categories

...