[root@hadoop01 /]# cd /root
[root@hadoop01 ~]# pwd
/root
[root@hadoop01 ~]# ll
总用量 1992
drwxr-xr-x. 3 root root 15 11月 6 2017 a
drwxr-xr-x. 3 root root 26 1月 31 2018 aa
-rw-r--r--. 1 root root 675840 1月 31 2018 aa.tar
-rw-------. 1 root root 1289 9月 23 2017 anaconda-ks.cfg
drwxr-xr-x. 3 root root 15 11月 6 2017 b
drwxr-xr-x. 3 root root 16 12月 12 2017 d1
drwxr-xr-x. 2 root root 6 1月 30 2018 d2
-rw-r--r--. 1 root root 0 1月 30 2018 f1
-rw-r--r--. 1 root root 146 9月 28 2017 f2.txt
-rw-r--r--. 1 root root 196 9月 28 2017 f.txt
-rw-r--r--. 1 root root 18 11月 15 09:46 go
-rw-r--r--. 1 root root 1200 1月 30 2018 passwd
-rw-r--r--. 1 root root 670293 11月 6 2017 s
-rw-r--r--. 1 root root 670293 6月 7 2013 services
[root@hadoop01 ~]# cd .ssh
[root@hadoop01 .ssh]# ls
authorized_keys id_rsa id_rsa.pub known_hosts
私钥
[root@hadoop01 .ssh]# vim id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA0vd+0uXNiAt8L65W1bJAc7Nw77flhdpQhECnapxEBY5rOgXY
3RUp+hciziRMGNq9O+pESmlY1OodWzeOCdlr0AcsvPIOw8h5PXDCgr1zFQM5CFry
7jmFeKqvDuakfHeKCeZ4CNpPPU/fxV94qfqGojcG/bWUE7GYEGIzrNs93X4CIi19
ozrl5UrzXDQShFRfNIzpyKXhSx0yiYMTLq05eQp3431vT4gs006N4NZFLh19L2qz
d7fiFXsB5mopsmeCb69KGej1H/Ph3lM9NoQ2BU6kehM6kjn4/Gn2Mqd5DBtV9wFf
j1UcWpBlW3EcwtBuYHr2GXMCqsaOiT07uadHSQIDAQABAoIBACWHFS5a5qbOtDaf
Ip886C4su2hJJDEdVrlP7vgN+COs4/IcXClnvGHaf7x/xHGfZ44i7Cb4em7Vfodd
aIzj+kO1IwYx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iJmz/CPdlKfk+AZryzK5VmndoNqDx
oVwYAdBgVEL4BfK+hdhFgGfHg7u1MQZFEhetcUHyIV7X0mgOvBvmjQ==
-----END RSA PRIVATE KEY-----
公钥
[root@hadoop01 .ssh]# vim id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDS937S5c2IC3wvrlbVskBzs3Dvt+WF2lCEQKdqnEQFjms6BdjdFSn6FyLOJEwY2r076kRKaVjU6h1bN44J2WvQByy88g7DyHk9cMKCvXMVAzkIWvLuOYV4qq8O5qR8d4oJ5ngI2k89T9/FX3ip+oaiNwb9tZQTsZgQYjOs2z3dfgIiLX2jOuXlSvNcNBKEVF80jOnIpeFLHTKJgxMurTl5CnfjfW9PiCzTTo3g1kUuHX0varN3t+IVewHmaimyZ4Jvr0oZ6PUf8+HeUz02hDYFTqR6EzqSOfj8afYyp3kMG1X3AV+PVRxakGVbcRzC0G5gevYZcwKqxo6JPTu5p0dJ root@hadoop01
接收到的公钥
[root@hadoop01 .ssh]# vim authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDS937S5c2IC3wvrlbVskBzs3Dvt+WF2lCEQKdqnEQFjms6BdjdFSn6FyLOJEwY2r076kRKaVjU6h1bN44J2WvQByy88g7DyHk9cMKCvXMVAzkIWvLuOYV4qq8O5qR8d4oJ5ngI2k89T9/FX3ip+oaiNwb9tZQTsZgQYjOs2z3dfgIiLX2jOuXlSvNcNBKEVF80jOnIpeFLHTKJgxMurTl5CnfjfW9PiCzTTo3g1kUuHX0varN3t+IVewHmaimyZ4Jvr0oZ6PUf8+HeUz02hDYFTqR6EzqSOfj8afYyp3kMG1X3AV+PVRxakGVbcRzC0G5gevYZcwKqxo6JPTu5p0dJ root@hadoop01
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpkhBhJkG+uZJhwlfszIcNmFKbCC2S13cGWe9ebreWJV4Zb7kZ0w9fhREY0XHxOrAkngcS9BZZV46lbdts63em93ioNdCd7y+Khp+zfPxTfx1oX2olGQknlS7JSgAysTnRAV9XZNGSWo21sMWMBMvRAfyQHd8Cn6BVArlUOIrpKOPq3lmWO7t2OSd6U7IzzpeiRc551Rb1DPRNZst5O9NPFI5ahMglICv2vfzLx+NhbZBt8FdOkCtAjAS06UOmBH3HKqwmzf6h1ch+YjCd8U2bbkja35oWpmWjtEUD7vtGzAlj0VeR0FaENf5el4U+rkL3tJopEqByETR2aXK4/ldX root@hadoop02
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCgBtNsa+bk7EvdslNMML4EqGFlZHtARUEJiD8Dnbj4Kbbyy6Sq9QyNbUvZ7u9ef0/eSh1lnaFfs9BmobIdBLt43X/Q/EBjfU9MhRe1vGIcgDnhsNvFoFH9r3WZJ+ZqoG1dS1ih8mnwgV9cI96+eLhBk704bW+Yi1BDHZtNmSHfWj1qAWmk+OHTB9hIDXFp7KCkBkbkcJwUghFk/Nl8lozVA+n7J0YKT+k6+yjH2wZdlECLSKdv2Dcncl5UTlykAM5tTHbluBDTWntx1LjF7Prp1cPjjzggMeqzQ1OQLgdoGRrqAjodshnXwofbCb4iE15szmDDbaBIbZEHuNjXV9wn root@hadoop03
本机接受的,已经知道的,建立互相信任关系的机器节点都有谁
[root@hadoop01 .ssh]# vim known_hosts
hadoop01,192.168.161.161 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOAurDTTFIBRFdIkS12t6U8JPirCWk61XNArgsnQW+IJ2VvYcjlkVpcm0x4oULhEzq8jTY/78+igIIeSKk36L2U=
hadoop02,192.168.161.162 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOAurDTTFIBRFdIkS12t6U8JPirCWk61XNArgsnQW+IJ2VvYcjlkVpcm0x4oULhEzq8jTY/78+igIIeSKk36L2U=
hadoop03,192.168.161.163 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOAurDTTFIBRFdIkS12t6U8JPirCWk61XNArgsnQW+IJ2VvYcjlkVpcm0x4oULhEzq8jTY/78+igIIeSKk36L2U=
0.0.0.0 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOAurDTTFIBRFdIkS12t6U8JPirCWk61XNArgsnQW+IJ2VvYcjlkVpcm0x4oULhEzq8jTY/78+igIIeSKk36L2U=