Linux@Linux-ThinkCentre-E75:~/文档/blogs$ ssh-keygen -t ed25519 -C "bs0716@126.com" Generating public/private ed25519 key pair. Enter file inwhich to save the key (/home/Linux/.ssh/id_ed25519): Created directory '/home/Linux/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/Linux/.ssh/id_ed25519 Your public key has been saved in /home/Linux/.ssh/id_ed25519.pub The key fingerprint is: SHA256:w1pBqIn8XtBaNIQIEo/pTOjqJxssGiQH7REkRB4zNyA bs0716@126.com The key's randomart image is: +--[ED25519 256]--+ |E@++ o... | |=**.o +. | |=++.= .. | |=oo.+ o.. | |.=o.+ S | |=. o .o . | |+o ... | |+o... | |.o+ | +----[SHA256]-----+ Linux@Linux-ThinkCentre-E75:~/文档/blogs$
Linux@Linux-Lenovo-XiaoXinPro-13API-2019:~$ ssh-keygen -t rsa -C 'Linuxdeepin007@gmail.com' Generating public/private rsa key pair. Enter file inwhich to save the key (/home/Linux/.ssh/id_rsa): Created directory '/home/Linux/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/Linux/.ssh/id_rsa Your public key has been saved in /home/Linux/.ssh/id_rsa.pub The key fingerprint is: SHA256:raNP4f208L04TjXseVXc6pIXWUA4HJicIFhGyDQizK8 Linuxdeepin007@gmail.com The key's randomart image is: +---[RSA 3072]----+ |+ .oo== .o =.+o | | + .+o . = + o.| | . . =| | . . .+.| | . S . B .| | E .+ = +.| | = o = = .| | o .*.* .| | ... .*.o.| +----[SHA256]-----+ Linux@Linux-Lenovo-XiaoXinPro-13API-2019:~$
2.通过查看 ~/.ssh/id_ed25519.pub 公钥,和~/.ssh/id_ed25519获取对私钥文件内容,获取到你的 public key
Linux@Linux-ThinkCentre-E75:~/文档/blogs$ ssh -T git@gitee.com The authenticity of host 'gitee.com (212.64.63.190)' can't be established. ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'gitee.com,212.64.63.190' (ECDSA) to the list of known hosts. Hi 望月砂! You've successfully authenticated, but GITEE.COM does not provide shell access. Linux@Linux-ThinkCentre-E75:~/文档/blogs$