加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

SSH 互信

发布时间:2020-12-14 03:23:58 所属栏目:大数据 来源:网络整理
导读:A:master B:server 在A B机器?当前用户的绝对目录 进行创建 .ssh? # mkdir ~/.ssh # chmod 700 .ssh/ # /usr/bin/ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase

A:master

B:server

在A B机器?当前用户的绝对目录 进行创建 .ssh?

# mkdir ~/.ssh
# chmod 700 .ssh/
# /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
41:21:31:03:97:5b:b2:c6:32:07:98:a5:4c:7d:28:c1 [email?protected]
The key‘s randomart image is:
+--[ RSA 2048]----+
| .o*oo*oo. |
| oE.+.+=. |
| o. + =. |
| o * . |
| = S |
| |
| |
| |
| |
+-----------------+


# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
# chmod 600 ~/.ssh/authorized_keys

?

拷贝 master 远程机器的 authorized_keys;粘贴到被远程的server 机器上; 然后直接远程就可以了

?

2、可以设置一个脚本进行执行;

然后把堡垒机的auth 拷贝到服务的机器上;

# cat in.sh

# cat in.sh

mkdir ~/.ssh chmod 700 .ssh/ /usr/bin/ssh-keygen -t rsa cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读