配置ssh等效连接(ssh-copy-id)

环境:
OS:Centos 7
机器A:192.168.1.100
机器B:192.168.1.102
机器C:192.168.1.103

目的:配置以上3台机器免密等效连接


1.机器A:192.168.1.100上操作
su - postgres
ssh-keygen -t rsa
ssh-copy-id -i postgres@192.168.1.100
ssh-copy-id -i postgres@192.168.1.102
ssh-copy-id -i postgres@192.168.1.103

ssh 192.168.1.100 date
ssh 192.168.1.102 date
ssh 192.168.1.103 date

 

2.机器B:192.168.1.102上操作
su - postgres
ssh-keygen -t rsa
ssh-copy-id -i postgres@192.168.1.102
ssh-copy-id -i postgres@192.168.1.100
ssh-copy-id -i postgres@192.168.1.103

ssh 192.168.1.102 date
ssh 192.168.1.100 date
ssh 192.168.1.103 date

 

3.机器C:192.168.1.103上操作
su - postgres
ssh-keygen -t rsa
ssh-copy-id -i postgres@192.168.1.103
ssh-copy-id -i postgres@192.168.1.102
ssh-copy-id -i postgres@192.168.1.100

ssh 192.168.1.103 date
ssh 192.168.1.102 date
ssh 192.168.1.100 date

 

-- The End --

posted @ 2023-01-09 14:14  slnngk  阅读(145)  评论(0编辑  收藏  举报