博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[原]linux 配置 ssh 等效性
阅读量:6094 次
发布时间:2019-06-20

本文共 2714 字,大约阅读时间需要 9 分钟。

在安装oracle数据库时,会需要为oracle用户配置ssh等效性,以实现不需要用户口令即可实现访问和文件传输。

 步骤如下:

创建目录并生成密码

[html] 
 
  1. su - oracle  
  2. mkdir ~/.ssh  
  3. chmod 755 ~/.ssh  
  4.   
  5. /usr/bin/ssh-keygen -t rsa ,连敲3次回车  
  6. /usr/bin/ssh-keygen -t dsa ,连敲3次回车  

创建认证文件并将密钥内容填入

[html] 
 
  1. touch ~/.ssh/authorized_keys  
  2. chmod 644 authorized_keys  
  3.   
  4. cat ~/.ssh/id_rsa.pub >> authorized_keys  
  5. cat ~/.ssh/id_dsa.pub >> authorized_keys  
  6. ssh racnode2 cat ~/.ssh/id_rsa.pub >> authorized_keys  
  7. ssh racnode2 cat ~/.ssh/id_dsa.pub >> authorized_keys  

 

在RAC的各个节点分别执行测试,测试是必须的,否则OUI可能会失败

[html] 
 
  1. [oracle@orcnode1 ~]$ ssh racnode1 date  
  2. [oracle@racnode1 ~]$ ssh racnode2 date  
  3. [oracle@racnode1 ~]$ ssh racnode1-priv date  
  4. [oracle@racnode1 ~]$ ssh racnode2-priv date  
  5.   
  6. [oracle@racnode2 ~]$ ssh racnode1 date  
  7. [oracle@racnode2 ~]$ ssh racnode2 date  
  8. [oracle@racnode2 ~]$ ssh racnode1-priv date  
  9. [oracle@racnode2 ~]$ ssh racnode2-priv date  

如果测试命令均可以在不需输入口令的情况下即可显示系统时间,则表示配置没有问题。 

示例样式配置:

[oracle@orclcentos2 ~]$ mkdir ~/.ssh

[oracle@orclcentos2 ~]$ chmod 755 ~/.ssh

[oracle@orclcentos2 ~]$ ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
5c:05:6b:3b:1c:8e:f8:e4:96:3e:7e:89:83:29:4d:07 oracle@orclcentos2
The key's randomart image is:
+--[ RSA 2048]----+
| ... |
| o |
| = |
| Eo * o |
| ..S = |
| .+.. . |
| o +=. . |
| . +o+ o |
| . .o+ |
+-----------------+
[oracle@orclcentos2 ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
58:36:4b:c4:89:34:22:cf:1c:b2:b1:a8:d8:d4:1b:b3 oracle@orclcentos2
The key's randomart image is:
+--[ DSA 1024]----+
| + o.oo.. |
| . @ o.oo |
|. + B = |
|oo = = o |
|o . E . S |
| |
| |
| |
| |
+-----------------+

[oracle@orclcentos2 ~]$ ssh rac2 cat ~/.ssh/id_rsa.pub >> authorized_keys

The authenticity of host 'rac2 (10.132.250.115)' can't be established.
RSA key fingerprint is 7f:e7:31:e0:f9:44:0f:19:98:69:a7:45:c7:40:ba:8f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2,10.132.250.115' (RSA) to the list of known hosts.
oracle@rac2's password:
[oracle@orclcentos2 ~]$ ssh rac2 cat ~/.ssh/id_dsa.pub >> authorized_keys
oracle@rac2's password:
[oracle@orclcentos2 ~]$

 

 

 

 

 

 

转载于:https://www.cnblogs.com/uniqueness/archive/2013/05/15/3079179.html

你可能感兴趣的文章
JAVA帮助文档全系列 JDK1.5 JDK1.6 JDK1.7 官方中英完整版下载
查看>>
jquery用法大全
查看>>
Groonga 3.0.8 发布,全文搜索引擎
查看>>
PC-BSD 9.2 发布,基于 FreeBSD 9.2
查看>>
网卡驱动程序之框架(一)
查看>>
用Hibernate Tools生成Hibernate Mapping映射文件
查看>>
php 过滤html标签的函数
查看>>
css斜线
查看>>
2013年第44周三可惡的中國聯通
查看>>
mysql导数据库用到的语句
查看>>
跨库查询(OpenDataSource)与链接服务器(Linking Server)
查看>>
Redis实现分布式锁
查看>>
Linux原始套接字实现分析---转
查看>>
UIWindow 介绍:概述、作用、主要属性及方法
查看>>
RH的NFS配置--简单OK
查看>>
Transcation And Lock--SQL SERVER 事务隔离级别
查看>>
Programmer Competency Matrix--ref--http://sijinjoseph.com/programmer-competency-matrix/
查看>>
jQuery如何设置自增自减值
查看>>
2013年度最佳 jQuery 插件集合(1) - 前端编程 - IT工作生活这点事。Just Su
查看>>
ASP.NET MVC:模块化/插件式文章汇总
查看>>