第5步:建立主机间的信任关系(sgdb1、sgdb2)
| [root@sgdb1 /]# su - oracle
[oracle@sgdb1 ~]$ mkdir .ssh 创建一个.ssh的隐藏目录
[oracle@sgdb1 ~]$ ls -al
total 44
-rw-r--r-- 1 oracle oinstall 33 Jul 12 17:05 .bash_logout
-rw-r--r-- 1 oracle oinstall 438 Jul 12 18:03 .bash_profile
drwxr-xr-x 4 oracle oinstall 4096 Jul 1217:05 .mozilla
drwx------ 2 oracle oinstall 4096 Jul 1218:05 .ssh
-rw------- 1 oracle oinstall 657 Jul 12 18:03 .viminfo
|
| [oracle@sgdb1 ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_rsa): enter
Enter passphrase (empty for nopassphrase): enter
Enter same passphrase again: enter
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:
64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:40oracle@sgdb1
|
| [oracle@sgdb1 ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter
Enter passphrase (empty for no passphrase):enter
Enter same passphrase again: enter
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:
7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:14oracle@sgdb1
|
| [oracle@sgdb2 asm]# su - oracle
[oracle@sgdb2 ~]$ mkdir .ssh
[oracle@sgdb2 ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_rsa): enter
Enter passphrase (empty for nopassphrase): enter
Enter same passphrase again: enter
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:
64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:40oracle@sgdb1
|
| [oracle@sgdb2 ~]$ ssh-keygen -tdsa
Generatingpublic/private dsa key pair.
Enter file inwhich to save the key (/home/oracle/.ssh/id_dsa): enter
Enter passphrase(empty for no passphrase): enter
Enter samepassphrase again: enter
Youridentification has been saved in /home/oracle/.ssh/id_dsa.
Your public keyhas been saved in /home/oracle/.ssh/id_dsa.pub.
The keyfingerprint is:
7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:14oracle@sgdb1
|
| [oracle@sgdb1 ~]$ ls .ssh
id_dsa id_rsa id_dsa.pub id_rsa.pub
[oracle@sgdb1 ~]$ cat.ssh/id_rsa.pub >>.ssh/authorized_keys
[oracle@sgdb1 ~]$ cat.ssh/id_dsa.pub >>.ssh/authorized_keys
[oracle@sgdb1 ~]$ ssh sgdb2 cat .ssh/id_rsa.pub>>.ssh/authorized_keys
oracle@sgdb2's password:
[oracle@sgdb1 ~]$ ssh sgdb2 cat .ssh/id_dsa.pub>>.ssh/authorized_keys
oracle@sgdb2's password: oracle的密码
|
| [oracle@sgdb1 ~]$ scp.ssh/authorized_keys sgdb2:~/.ssh
oracle@sgdb2's password: oracle的密码
|
| [oracle@sgdb1 ~]$ ssh sgdb2 date
[oracle@sgdb1 ~]$ ssh sgdb 2-privdate //私有ip地址验证
[oracle@sgdb1 ~]$ ssh sgdb 1date
[oracle@sgdb1 ~]$ ssh sgdb 1-privdate
|
| [oracle@sgdb2 ~]$ ssh sgdb1 date
[oracle@sgdb2~]$ ssh sgdb 1-priv date
[oracle@sgdb2 ~]$ ssh sgdb2 date
[oracle@sgdb2~]$ ssh sgdb2-priv date
|
| [root@sgdb1 /]# su– grid
[grid@sgdb1 ~]$mkdir .ssh 创建一个.ssh的隐藏目录
[grid@sgdb1 ~]$ ls-al
|
| [grid@sgdb1 ~]$ ssh-keygen-t rsa
Generating public/private rsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_rsa): enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
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:
64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:40oracle@sgdb1
|
| [grid@sgdb1 ~]$ ssh-keygen-t dsa
Generating public/private dsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
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:
7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:14oracle@sgdb1
|
| [root@sgdb2 ~]# su – grid
[grid@sgdb2 ~]$ mkdir .ssh
[grid@sgdb2 ~]$ ssh-keygen-t rsa
Generating public/private rsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_rsa): enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
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:
64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:40oracle@sgdb1
|
| [grid@sgdb2 ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
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:
7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:14oracle@sgdb1
|
| [grid@sgdb1 ~]$ ls .ssh
id_dsa id_rsa id_dsa.pub id_rsa.pub known_hosts
[grid@sgdb1 ~]$ cat.ssh/id_rsa.pub >>.ssh/authorized_keys
[grid@sgdb1 ~]$ cat.ssh/id_dsa.pub >>.ssh/authorized_keys
[grid@sgdb1 ~]$ ssh sgdb2 cat .ssh/id_rsa.pub>>.ssh/authorized_keys
grid@sgdb2's password:
[grid@sgdb1 ~]$ ssh sgdb2 cat .ssh/id_dsa.pub >>.ssh/authorized_keys
grid@sgdb2's password: grid的密码
|
| [grid@sgdb1 ~]$ scp.ssh/authorized_keys sgdb2:~/.ssh
grid@sgdb2's password: grid的密码
authorized_keys 100% 1992 2.0KB/s 00:00
|
| [grid@sgdb1 ~]$ ssh sgdb2 date
[grid@sgdb1 ~]$ ssh sgdb2-priv date
[grid@sgdb1 ~]$ ssh sgdb1 date
[grid@sgdb1 ~]$ ssh sgdb 1-priv date
|
| [grid@sgdb2 ~]$ ssh sgdb1 date
[grid@sgdb2~]$ ssh sgdb1-priv date
[grid@sgdb2 ~]$ ssh sgdb2 date
[grid@sgdb2~]$ ssh sgdb2-priv date
|
第5步:建立主机间的信任关系(sgdb1、sgdb2)的更多相关文章
- Solaris主机间的信任关系机制
解决问题: 管理员经常在其他服务器之间登录,是否需要密码切换. 知识点:主机间信任关系.R 命令集 /etc/hosts/equiv 文件 R服务是不加密的,别人可以破解. 主机名 + 用户名. + ...
- Android手机与计算机间的”信任关系”
在iDevices(如iPhone.iPad等等)的取证方面,那个代表”信任关系”的plist无疑是最为关键的迹证,只要有了它,哪怕是最新机型的iDevice及最新版的iOS,且有着指纹保护或pass ...
- [域|Domain] The trust relationship between this workstation and the primary domain failed 此工作站和主域间的信任关系失败
PS> $cred = Get-Credential domain.sample.com;Reset-ComputerMachinePassword -Credential $cred -Ser ...
- ssh两台机器建立信任关系无密码登陆
在建立信任关系之前先看看基于公钥.私钥的加密和认证. 私钥签名过程 消息-->[私钥]-->签名-->[公钥]-->认证 私钥数字签名,公钥验证 Alice生成公钥和私钥,并将 ...
- centos下建立双机信任关系
在有些情况下,我们希望在两台centos机器之间建立ssh连接的时候,可以不用输入密码.最常见的情况就是在使用脚本做数据库备份的时候.这种情况下,我们可以通过公钥/私钥来建立双机之间的信任关系. 网上 ...
- 【Linux学习笔记】用nc实现两台主机间的文件传输(不需要输密码)
通常,可以用scp完成两台主机间的文件传输任务,但在主机间未建立信任关系的情况下,scp每次都需要输入密码,用起来感觉不是很方便,之前这篇笔记介绍过不用输入密码执行脚本或传输文件的方法,但对于一些临时 ...
- linux机器间建立信任关系
linux机器间建立信任关系 如何建立信任关系 在shell脚本中,需要使用scp命令将本地的文件复制到另一台机器中备份.但通常执行scp命令后都需要输入用户密码,这样在定时自动执行shell脚本中就 ...
- linux建立信任关系
(1).切换到需要建立信任关系的用户(2).执行命令:ssh-keygen -d,然后一直回车.该命令会在用户home目录下生成一个隐藏的.ssh目录.目录里面有两个文件:id_dsa.id_dsa ...
- 建立SSH的信任关系
1.在Client上root用户执行ssh-keygen命令,生成建立安全信任关系的证书. Client端 # ssh-keygen -t rsa Generating public/private ...
随机推荐
- com.android.support冲突的解决办法
All com.android.support libraries must use the exact same version specification (mixing versions can ...
- 使用Firefly编写简易聊天室
1.创建工程命令行下输入firefly-admin.py createproject chat_rooms(linux在终端输入),<ignore_js_op> firefly会在C盘Us ...
- windows域相关
查看域角色: netdom query fsmo
- Tomcat日志、项目中的log4j日志、e.printStackTrace()——我的日志最后到底跑哪去了?
1.Tomcat自带日志功能,即时你的项目中有log4j也不会影响到Tomcat自己记录日志. 2.你的项目中的log4j中的日志指定打印到什么地方(控制台或者文件),便会打印到什么地方,和Tomat ...
- 制作可以 SSH 登录的 Docker 镜像
Docker使用系列一我们把镜像源改为了阿里云的,方便后续的操作. 执行这个命令就把源地址改为阿里的: curl https://git.oschina.net/feedao/Docker_shell ...
- Js随机生成指定长度字符串
function a(a) { var d, e, b = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&q ...
- Atitit. 单列索引与多列索引 多个条件的查询原理与设计实现
Atitit. 单列索引与多列索引 多个条件的查询原理与设计实现 1. MySQL只能使用一个索引1 1.1. 最左前缀1 1.2. 从另一方面理解,它相当于我们创建了(firstname,last ...
- vivado设计四:自定义IP核测试
在vivado设计三中:http://blog.chinaaet.com/detail/37177已经建立了vivado工程和封装好了自定义IP核. 那么接下来,我们对这个自定义IP核进行测试了:我们 ...
- oracle /plsql 计算平闰年天数函数
--计算平闰年天数函数 CREATE OR REPLACE FUNCTION f_ping_run_nian (i_year NUMBER --定义函数名 ) RETURN VARCHAR2 IS - ...
- 脚本 sh 和 ./ 的区别,exec和source
如果.不在PATH里面,要执行当前目录下的可执行文件,使用全路径: ./executable-file PATH是环境变量,如果将当前目录“./”添加到环境变量中,那么也可以不用“./”,直接输入当前 ...