<> Public key Private key

When we connect our own git Time , Every time pull or
push Code will let us repeatedly enter our own password , The problem is not that we're connected , It's right git The public key and private key are not well understood , Using commands ssh-keygen, The default generated public key name is id_rsa.pub
, The private key name is id_rsa.
$ cat ~/.ssh/id_rsa.pub ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU GPl+
nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3 Pbv7kOdJ/
MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA
t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En mZ+
AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx NrRFi9wrf
+M7Q== schacon@mylaptop.local
<> solve

Terminal prompt :Enter passphrase for
key, It means that we are git Private key used , On the basis of public key, we add a guarantee , So there will be repeated input passwords , Switch to file cd ~/.ssh
There will be id_rsa,id_rsa.pub,known_hosts Three documents , Using commands rm id_rsa* Delete our private key ,cd … Switch directory , implement
ssh-keygen -t rsa -C “ Your email ” -b 4096 All way return key , appear
+---[RSA 2096]----+ |.o ....+ | |o . . .=o..o | |.E . .. oo . | |=.o . | |.*
S o o | |. o . + o . | |..o+ = o | |..=o=.* . | |..+B=X+o | +----[SHA256]-----
+
And then re-enter cd ~/.ssh The document , implement cat id_rsa.pub Copy and paste the code to your remote git Establish association on , complete .

<> other

The above are the problems I encountered in the development , The practical part of the data has not been solved . If the above is not solved , Try someone else's way , It's still local ssh-a -K
Enter your password , Or in turn eval ssh-agent ssh-add
command , These commands can only be used when you are currently on , Not typing your git password , After you turn off your device again , After restart , You will still be prompted to enter , Try the above solution .

Technology