1.客户端

ssh-keygen 
yum  install  openssl-clients -y
#一路回车生成公钥和私钥
#id_rsa: 私钥   id_rsa.pub:公钥
ssh-copy-id  -i .ssh/id_rsa.pub  用户@目标ip地址

2.服务端

开放22端口给客户端