手工配置ssh





实验环境:

操作系统:RELHAT6.4

数据库版本:oracle 11.2.0.4

Grid用户:

1、生成密钥

[grid@rac1 ~]$ ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/home/grid/.ssh/id_rsa):

Created directory ‘/home/grid/.ssh’.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/grid/.ssh/id_rsa.

Your public key has been saved in /home/grid/.ssh/id_rsa.pub.

The key fingerprint is:

44:49:c9:7f:c6:16:b5:c7:78:b2:91:40:ef:4e:4c:5d grid@rac1

The key’s randomart image is:

+–[ RSA 2048]—-+

|       ooo .o.. E|

|       .+   .o *.|

|        .. . .O =|

|       .  . =+ * |

|        S  +  =  |

|             o   |

|              .  |

|                 |

|                 |

+—————–+

将密钥输出在authorized_keys

[grid@rac1 .ssh]$ cat id_rsa.pub >> authorized_keys

二节点同样生成密钥:

[grid@rac2 ~]$ ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/home/grid/.ssh/id_rsa):

Created directory ‘/home/grid/.ssh’.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/grid/.ssh/id_rsa.

Your public key has been saved in /home/grid/.ssh/id_rsa.pub.

The key fingerprint is:

13:c0:1b:8d:8f:3e:0b:81:14:5e:0f:17:2e:09:1b:81 grid@rac2

The key’s randomart image is:

+–[ RSA 2048]—-+

| .=oo.++         |

|E..= *+..        |

| .o.o o=.        |

|  . ..o ..       |

|     o  S        |

|    . o  .       |

|     . o         |

|      .          |

|                 |

+—————–+

将二节点的密钥输入一节点的authorized_keys

[grid@rac1 .ssh]$ ssh rac2 cat .ssh/id_rsa.pub >> authorized_keys

The authenticity of host ‘rac2 (20.0.0.11)’ can’t be established.

RSA key fingerprint is 69:4c:57:b5:b0:17:2e:7a:06:d4:f1:85:89:55:95:52.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘rac2,20.0.0.11′ (RSA) to the list of known hosts.

最后再将一节点的authorized_keys同步到二节点

[grid@rac1 .ssh]$ scp authorized_keys rac2:.ssh

Oracle用户做相同操作,用以下方法检测是否配置成功

[grid@rac2 ~]$  ssh rac1 date;ssh rac1-priv date;ssh rac2 date;ssh rac2-priv date

如果不需要输入密码直接输出时间则配置成功




Related posts

coded by nessus
分享:  DeliciousGReader鲜果豆瓣CSDN网摘
Trackback

no comment untill now

Add your comment now

无觅相关文章插件