虚拟机中多个Linux系统之间配置免秘钥访问

1、三个节点cdh1,cdh2,cdh3

2、在每个机器上分别生产公钥对

ssh-keygen -t rsa

3、复制公钥

cd .ssh

cat  id_rsa.pub  >> authorized_keys

4、修改authorized_keys权限

chmod   600 authorized_keys

5、将authorized_keys复制到cdh2

scp authorized_keys root@cdh2:/root/.ssh/

6、将cdh2中id_rsa.pub公钥添加到authorized_keys中

cat  id_rsa.pub  >> authorized_keys

7、将authorized_keys复制到cdh3

scp authorized_keys root@cdh3:/root/.ssh/

8、将cdh3中id_rsa.pub公钥添加到authorized_keys中

cat  id_rsa.pub  >> authorized_keys

9、将authorized_keys分别复制到cdh1和cdh2

scp authorized_keys root@cdh1:/root/.ssh/

scp authorized_keys root@cdh2:/root/.ssh/

到此这三个节点都可以免密访问了:

ssh cdh1

ssh cdh2

ssh cdh3

记录每一个站姿势的瞬间。。。

posted @ 2017-11-19 15:58  麻雀虽小五脏俱全  阅读(623)  评论(0编辑  收藏  举报