Install SSH key

git log --oneline

https://viblo.asia/p/git-hoc-nghiem-tuc-mot-lan-phan-1-OeVKBo6JZkW https://techblog.vn/git-hoc-nghiem-tuc-mot-lan-phan-2

Install SSH key

  • Tronmg Git, nếu bạn sử dụng giao thức HTTPS để truyền tải dữ liệu giữa server và client thì mỗi lần bạn pull hay push đều cần phải nhập lại email và mật khẩu GitHub, vậy hãy dùng giao thức SSH như sau:

  • Gõ câu lệnh sau vào Terminalssh-keygen -t rsa -C "abc@gmail.com"

  • Câu lệnh trên sẽ sinh ra một public key và một private key, private key thì tuyệt đối đừng chia sẻ, còn public key thì share nó với github.

  • Bạn sẽ thấy dòng chữ: Your public key has been saved in: + path. Theo path đó, mở file và copy public key.

  • Đăng nhập vào GitHub -> Setting -> SSH and GPG keys -> Add new SSH key

  • Điền public key và nhấp okie, từ giờ bạn có thể dùng giao thức SSH được rồi.

ssh-keygen -t rsa -C "tuongpn@shopdunk.vn"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/lionel/.ssh/id_rsa): key
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in key.
Your public key has been saved in key.pub.
The key fingerprint is:
SHA256:aYnP6AUnpAU6qC/ovcVECo3BhlUV8ir2JEHPAk8hK+k tuongpn@shopdunk.vn
The key's randomart image is:
+---[RSA 2048]----+
|=o=o+.o.         |
|.%++ +           |
|*o*.o.+          |
|+ .+o= . o       |
|.E+.+.+ S        |
|.o =o  O         |
|o . .o. +        |
|... .. .         |
| . o. .          |
+----[SHA256]-----+

Last updated