[root@node1 jdk1.7.0_80]# ssh root@node2 "mkdir .ssh;chmod 0700 .ssh"
The authenticity of host 'node2 (192.168.137.102)' can't be established.
ECDSA key fingerprint is SHA256:pOigsCPjt5BQwCdHruKtW9JVNxY5V80/cIv3fjJjqcs.
ECDSA key fingerprint is MD5:22:b9:63:95:42:77:7d:9e:39:be:36:f7:89:1b:1d:4d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2,192.168.137.102' (ECDSA) to the list of known hosts.
root@node2's password:
[root@node1 jdk1.7.0_80]# scp ~/.ssh/id_rsa.pub root@node2:.ssh/id_rsa.pub
root@node2's password:
id_rsa.pub 100% 392 205.9KB/s 00:00
[root@node1 jdk1.7.0_80]# ssh root@node2
Last login: Mon Apr 1 04:36:23 2019 from node1
[root@node2 ~]# exit
登出
Connection to node2 closed.
[root@node1 jdk1.7.0_80]#
A为本地主机(即用于控制其他主机的机器) ;