$ssh-keygen-t rsa-c "${email}" # "-T RSA" indicates the type of encryption used for the key and can also be DSA; " -C "Sets the comment text (RSA supports the variable-length key algorithm.) DSA Digital Signature algorithm is standard for digital signature)
Generate the. Ssh/id_rsa key
and. Ssh/id_rsa.pub public key cat id_rsa.pub--added to GitHub's SSH keys
The 1.SSH client stores the SSH public key to the SSH server in advance, and then the SSH client carries the public key to initiate a login request to the remote SSH server
2. The remote side receives the request, finds the public key in the server's Authorized_keys and compares
3. Remotely send a public key encrypted random string for identity challenge
4.SSH client decrypts and sends back to remote server with its own private key
Test:
ssh-t [email protected]
(Reference document: http://blog.csdn.net/phunxm/article/details/45083335)
Upload file: Git remote add origin [email protected]://github.com/xxue~ associated with a remote library
Git push-u origin master pushes all content on the master branch for the first time
GIT pushes branch content after Origin master
Git library Add encryption key