配置Linux两节点SSH密钥信任
首先感谢兄弟“瑞瑞”提供资料
1. 生成两节点Oracle用户SSH密钥
Racnode1
[oracle@racnode1 ~]$ll -a
total 32K
drwxr-xr-x 3 oracle oinstall 4.0K Jun 13 15:08 .kde
-rw-r--r-- 1 oracle oinstall 120 Jun 13 15:08 .gtkrc
-rw-r--r-- 1 oracle oinstall 124 Jun 13 15:08 .bashrc
-rw-r--r-- 1 oracle oinstall 191 Jun 13 15:08 .bash_profile
-rw-r--r-- 1 oracle oinstall 24 Jun 13 15:08 .bash_logout
drwxr-xr-x 3 root root 4.0K Jun 13 15:08 ..
drwx------ 3 oracle oinstall 4.0K Jun 13 15:08 .
[oracle@racnode1 ~]$ssh-keygen -t rsa--------------------->【一路回车】
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Created directory '/home/oracle/.ssh'.
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:
8a:11:ad:48:03:3b:94:b4:bb:a9:fb:b4:df:e1:18:87 oracle@racnode1
[oracle@racnode1 ~]$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:
7d:9e:de:16:85:71:36:09:d3:9e:03:d2:1e:fd:d6:1a oracle@racnode1
[oracle@racnode1 ~]$cat .ssh/*.pub > .ssh/authorized_keys
[oracle@racnode1 ~]$ll -a--------------------->【生成.ssh目录,密码钥也已生成】
total 20K
-rw-r--r-- 1 oracle oinstall 225 Jun 13 15:30 id_rsa.pub
-rw------- 1 oracle oinstall 883 Jun 13 15:30 id_rsa
-rw-r--r-- 1 oracle oinstall 605 Jun 13 15:30 id_dsa.pub
-rw------- 1 oracle oinstall 668 Jun 13 15:30 id_dsa
-rw-r--r-- 1 oracle oinstall 830 Jun 13 15:35 authorized_keys
Racnode2
[oracle@racnode1 ~]$ll -a
total 32K
drwxr-xr-x 3 oracle oinstall 4.0K Jun 13 15:08 .kde
-rw-r--r-- 1 oracle oinstall 120 Jun 13 15:08 .gtkrc
-rw-r--r-- 1 oracle oinstall 124 Jun 13 15:08 .bashrc
-rw-r--r-- 1 oracle oinstall 191 Jun 13 15:08 .bash_profile
-rw-r--r-- 1 oracle oinstall 24 Jun 13 15:08 .bash_logout
drwxr-xr-x 3 root root 4.0K Jun 13 15:08 ..
drwx------ 3 oracle oinstall 4.0K Jun 13 15:08 .
[oracle@racnode2 ~]$ssh-keygen -t rsa--------------------->【一路回车】
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Created directory '/home/oracle/.ssh'.
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:
8a:11:ad:48:03:3b:94:b4:bb:a9:fb:b4:df:e1:18:87 oracle@racnode1
[oracle@racnode2 ~]$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:
7d:9e:de:16:85:71:36:09:d3:9e:03:d2:1e:fd:d6:1a oracle@racnode1
[oracle@racnode2 ~]$cat .ssh/*.pub > .ssh/authorized_keys
[oracle@racnode2 ~]$ll .ssh/--------------------->【生成.ssh目录,密码钥也已生成】
total 20K
-rw-r--r-- 1 oracle oinstall 225 Jun 13 15:34 id_rsa.pub
-rw------- 1 oracle oinstall 883 Jun 13 15:34 id_rsa
-rw-r--r-- 1 oracle oinstall 605 Jun 13 15:34 id_dsa.pub
-rw------- 1 oracle oinstall 672 Jun 13 15:34 id_dsa
-rw-r--r-- 1 oracle oinstall 830 Jun 13 15:36 authorized_keys
2. 配置两节点Oracle用户SSH无密码登陆的信任关系
Racnode1
The authenticity of host '10.10.10.102 (10.10.10.102)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.10.10.102' (RSA) to the list of known hosts.
oracle@10.10.10.102's password:RacNode2节点Oracle用户的密码
authorized_keys 100% 830 0.8KB/s 00:00
Racnode2
[oracle@racnode2 ~]$scp .ssh/authorized_keys oracle@10.10.10.101:/home/oracle/.ssh/
The authenticity of host '10.10.10.101 (10.10.10.101)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.10.10.101' (RSA) to the list of known hosts.
oracle@10.10.10.101's password: RacNode1节点Oracle用户的密码
authorized_keys 100% 830 0.8KB/s 00:00
3. 配置两节点Oracle用户信任关系的测试
Racnode1
The authenticity of host 'racnode1 (10.10.10.101)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Last login: Mon Jun 13 15:44:03 2011 from racnode1
[oracle@racnode1 ~]$exit
logout
Connection to racnode1 closed.
[oracle@racnode1 ~]$ssh racnode2
The authenticity of host 'racnode2 (10.10.10.102)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Last login: Mon Jun 13 15:44:03 2011 from racnode1
[oracle@racnode2 ~]$exit
logout
Connection to racnode1 closed.
[oracle@racnode1 ~/.ssh]$ssh racnode1-priv
The authenticity of host 'racnode1-priv (192.168.0.101)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'racnode1-priv,192.168.0.101' (RSA) to the list of known hosts.
Last login: Mon Jun 13 15:46:07 2011 from racnode1
[oracle@racnode1 ~]$exit
logout
Connection to racnode1-priv closed.
[oracle@racnode1 ~/.ssh]$ssh racnode2-priv
The authenticity of host 'racnode2-priv (192.168.0.102)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'racnode2-priv,192.168.0.102' (RSA) to the list of known hosts.
Last login: Mon Jun 13 15:46:59 2011 from racnode1
[oracle@racnode2 ~]$exit
logout
Connection to racnode2-priv closed.
Racnode2
The authenticity of host 'racnode1 (10.10.10.101)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'racnode1' (RSA) to the list of known hosts.
Last login: Mon Jun 13 15:49:14 2011 from racnode1-priv
[oracle@racnode1 ~]$exit
logout
Connection to racnode1 closed.
[oracle@racnode2 ~]$ssh racnode2
The authenticity of host 'racnode2 (10.10.10.102)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'racnode2,10.10.10.102' (RSA) to the list of known hosts.
Last login: Mon Jun 13 15:49:28 2011 from racnode1-priv
[oracle@racnode2 ~]$exit
logout
Connection to racnode2 closed.
[oracle@racnode2 ~]$ssh racnode1-priv
The authenticity of host 'racnode1-priv (192.168.0.101)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'racnode1-priv,192.168.0.101' (RSA) to the list of known hosts.
Last login: Mon Jun 13 15:49:56 2011 from racnode2
[oracle@racnode1 ~]$exit
logout
Connection to racnode1-priv closed.
[oracle@racnode2 ~]$ssh racnode2-priv
The authenticity of host 'racnode2-priv (192.168.0.102)' can't be established.
RSA key fingerprint is 3c:84:f4:d9:d8:88:2d:9c:99:47:6a:21:1c:93:95:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'racnode2-priv,192.168.0.102' (RSA) to the list of known hosts.
Last login: Mon Jun 13 15:50:16 2011 from racnode2
[oracle@racnode2 ~]$exit
logout
Connection to racnode2-priv closed.
转载于:https://www.cnblogs.com/qq78292959/archive/2011/06/15/2081696.html
配置Linux两节点SSH密钥信任相关推荐
- linux下生成ssh密钥并获取密钥
转载自 在linux上生成SSH-key 简单原理介绍+生成步骤 1.首先什么是SSH Secure Shell (SSH) 是一个允许两台电脑之间通过安全的连接进行数据交换的网络协议. 通过加密保证 ...
- Linux安全之SSH 密钥创建及密钥登录
创建秘钥 1.首先进入Linux系统的用户目录下的.ssh目录下, root用户是/root/.ssh,普通用户是/home/您的用户名/.ssh,我们以root用户为例: cd .ssh #如果没有 ...
- Linux下使用ssh密钥实现无交互备份
服务器A(主) 192.168.1.120 服务器B(从) 192.168.1.130 需求:服务器B定期拉取服务器A的数据并备份. 实现方式: 一.备份服务器B安装rsync 1)查看是否安装 ...
- 建立linux两用户之间的信任关系
有a和b两台机器,现要将a机器的user1用户添加到b机器的user2用户信任列表里,使a机器的user1用户可以直接ssh到b机器的user2用户 步骤: 1,进入a机器/home/user1/.s ...
- linux服务器忘记ssh密码_【Linux】配置linux服务器之间ssh不用密码访问
如果想在 A 这太机器上可以不需要密码就 ssh 到 B . C 两台机器上,可以采用如下的方法: ( 1 ) 在 A 机器上: ssh-keygen -t rsa Generating public ...
- 配置linux开发板ssh登录
linux开发板作为服务端,所以要修改sshd_config文件 注:不是修改ssh_config文件 修改步骤: 进入/etc/ssh目录:cd /etc/ssh 备份sshd_config文件(可 ...
- 配置多个git账号的ssh密钥
博客改版,请直接访问新版文章:https://www.cnblogs.com/xiaoxi666/p/9975981.html 背景 我们在工作中会以 ssh 的方式配置公司的 git 账号,但是平时 ...
- Github使用ssh密钥登陆
Github使用ssh密钥登陆 生成SSH密钥 配置Github 检查SSH连接 使用Github 附录:更改密钥名称 方法一:为已创建的密钥改名 方法二:创建时使用新的名称 参考链接 想要从linu ...
- 如何指定在Git上执行shell命令时使用的私有SSH密钥?
也许是一个相当不寻常的情况,但我想指定一个私有SSH密钥,以便在从本地计算机执行shell(git)命令时使用. 基本上是这样的: git clone git@github.com:TheUser/T ...
最新文章
- opencv中ArUco模块实践(1)
- 安卓的自定义的DemoApplication 出现的问题。
- Dokan虚拟磁盘开发实战
- IOS debug网络PonyDebugger 实践篇
- 几款让你爱不释手的语音转文字软件
- 1095 解码PAT准考证 (25 分)
- k8s集群之master节点部署
- 判断手机上是否安装某个APP(iOS)
- 分享阿里云ace考试攻略 详解ACP认证考试须知
- ListView刷新指定item
- QNX系统配置NFS实战
- 微计算机cpu是指什么,微处理器和CPU的不同是什么
- 计算机导论——计算机软件03
- 呷哺呷哺的中年危机与贺光启的囚徒困境
- 史上最贵的merge代码,新浪程序员因加班错失年会77万大奖!
- 倒计时7天丨2022全球边缘计算大会深圳站参会指南来啦!
- 如何规避适配风险?以《乱世王者》为例,探秘手游兼容性测试之路
- 现在公司都不缺人了?软件测试工作经历3年,面试居然被坑了....
- rpm包安装简单方法
- java excel 插入新行_复制一行,在多个工作表Excel VBA上插入多个带有粘贴信息的新行...
热门文章
- 源码读不会,小白两行泪!
- HashSet 和 LinkedHashSet 源码分析,竟如此简单!
- 为什么中国程序员水平一直上不了层次?无非是这些原因!
- 原子变量、锁、内存屏障,写得非常好!
- 我是如何面试别人List相关知识的
- JVM:内存分配与回收策略?Full GC 的触发条件?StopTheWorld ?
- 【Python】青少年蓝桥杯_每日一题_4.03_求偶数
- 计算机英语应用研究,计算机英语辅助学习系统的研究与应用-软件工程专业论文.docx...
- fileviewfinder.php,Laravel在FileViewFinder.php中查找视图的错误处理程序
- 怎么看java中ide_如何在eclipse IDE中查看Java的字节码?