[root@gitlab212 ~]# ssh-keygen #生成密钥对 Generating public/private ed25519 key pair. Enter file in which to save the key (/root/.ssh/id_ed25519): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_ed25519 Your public key has been saved in /root/.ssh/id_ed25519.pub The key fingerprint is: SHA256:GMd0qYCfisI7YgnL9gaTOvhSg9VWYVOtJ/ZmClhYCPc root@gitlab212 The key's randomart image is: +--[ED25519 256]--+ | ...o+oo... | | .oo++ .o | | . =Eooo | | . + ++= . | |.o.o +..S+ | |+=+ o . + | |=+=. . + | |BB . . | |++=. | +----[SHA256]-----+ [root@gitlab212 ~]# [root@gitlab212 ~]# ll .ssh/ total 16 drwx------ 2 root root 4096 Dec 17 07:57 ./ drwx------ 4 root root 4096 Dec 15 12:01 ../ -rw------- 1 root root 0 Jul 23 16:40 authorized_keys -rw------- 1 root root 411 Dec 17 07:57 id_ed25519 #私钥 -rw-r--r-- 1 root root 96 Dec 17 07:57 id_ed25519.pub #公钥 [root@gitlab212 ~]# cat .ssh/id_rsa.pub cat: .ssh/id_rsa.pub: No such file or directory [root@gitlab212 ~]# cat .ssh/id_ed25519.pub ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILkNNA0/prl380e574O6+cfOSOAbpeJl+zhEdS5e58 root@gitlab212
[root@jenkins211 ~]# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa Your public key has been saved in /root/.ssh/id_rsa.pub The key fingerprint is: SHA256:8f0e/2XSZCdAGULp+LEkvVjeFo7YVJWv7HDFQDzfi1I root@jenkins211 The key's randomart image is: +---[RSA 3072]----+ | .o.o*o. | | .oo = | | .+ .. *.| | ooB..E *| |[email protected]=| | o B.=o+*.| | ..++ +| | ..=.| | . +| +----[SHA256]-----+ [root@jenkins211 ~]# [root@jenkins211 ~]# cat .ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCrTMTf0oqtW7GktgZBdhqkjCBp2xGCcGeEo8ZcEKaN352TDMGKRI5O+0gAwUBj9HMAkPASJsejtTQIrT5jkBuW/8L5RXPDqCCyuzz1nkW/rPiyVvuAvvkQxFMBxL4w/AoDAhcsxpV73DCyYTrjQ8Tj7PfSViEUKZFpPbtroOZeCgCVa/mNPj7hGI2xUapKd0rdiGpXlDMPlD1uN9TET1WTj157QbYbgtsA6y+K2hjG97HHta0miovC4vqbaKQuohbYThbkwE5v6Ndjg8WSYjXEO6SDgemR6/c/JIyMPv1rNUitzl6dg4jykJ2pCTsemvFL7Vdjypbn9l0bPK8cq+mz0W8ZKLd2Ijqshj67SFWjFxJs0/yabg3jdMTdnYxRYdiG2vaMlAmtgGbXAUGXMqCzXNftmSpyqlSxGhfKLUC76LCqc4nBhqt2reN3L5yd/rzVZENdpok8cdV/dZag8ibzlgeqOL60ONThYTPZTACyw+U2K2HhqLmoCVDpYxU= root@jenkins211