P
P
Pavel2016-09-25 01:12:48
git
Pavel, 2016-09-25 01:12:48

How to fix persistent SSH config reset (authorization) in Git?

Hello friends)
I came across a funny problem with git (using a small git bash shell under windows):
SSH authorization for github is reset after closing the console.
Every time you start the console (including native cmd) it gives the following errors about accessing github.
3ed3319a2a1f4dcbb867ef7d7dfa4d11.png
The problem goes away (everything works fine) if you log in using the commands:

eval "$(ssh-agent -s)"
$(ssh-add win_rsa)
ssh-add -l -E md5 #check
ssh -T [email protected] # Hi PaVM! You've successfully authenticated, but GitHub does not provide shell access.

e1c2bc873be5407ab6c342c87a854abf.png
But you should close the console and open it again, as the authorization flies :(
I tried to write the Shell Script in a separate file so as not to rewrite the same thing from scratch. But it turned out that everything works fine only if the commands are added inside the file.
5740700918a24f42a51da471837d111b.png
I think this is the case in that the state is saved only in the context of the subroutine.Maybe
someone came across what to do with this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2016-09-29
@ProgramCodePav

The problem was the ssh-agent being disabled when the console was closed. It needs to be added to autorun: github guide
In Windows, in the user's folder, create .bashrc and .profile . We add the code according to the guide and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question