ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 两台Linux服务器之间配置互信

两台Linux服务器之间配置互信

原创 Linux操作系统 作者:kakaxi9521 时间:2016-12-16 10:28:25 0 删除 编辑
最近配了个备份,备份在服务器A上,需要将备份的数据通过scp传输到服务器B上进行保留,所以涉及到配置A到B的信任关系。
1. 在A服务器上
[oracle@A yebiao]$ 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:
f2:0f:64:1c:0d:20:db:9b:9d:45:0a:23:b9:97:f3:83 oracle@A服务器
The key's randomart image is:
+--[ RSA 2048]----+
|    o.+.. .      |
|    .= o =       |
|    ....o o      |
|    . += +       |
|     .++S        |
|      E=o        |
|        o.       |
|         o       |
|          .      |
+-----------------+

2. 将生成的id_rsa.pub文件拷贝到B服务器的.ssh目录下。
scp /home/oracle/.ssh/id_rsa.pub 10.18.1.119:/home/backup/.ssh/a.pub

3. 将a.pub的内容加入到authorized_keys文件里。
cat a.pub >> authorized_keys

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21374452/viewspace-2130760/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-04-13

  • 博文量
    136
  • 访问量
    179046