Centos 7 下實現多虛擬機器互信

來源:互聯網
上載者:User

標籤:ssh互信 linux

假設三台虛擬機器A(10.139.8.82)、B(10.139.8.83)、C(10.139.8.84),需要保證三台虛擬機器之間網路的連通性。


操作步驟:


一、在A機上配置


①以root使用者登入,更改ssh設定檔 /etc/ssh/sshd_config

RSAAuthentication yes #啟用rsa認證

PubkeyAuthentication yes #啟用公開金鑰私密金鑰配對認證方式

AuthorizedKeysFile .ssh/authorized_keys #公開金鑰檔案路徑


[[email protected] /]#systemctl restart sshd  //重啟ssh服務


②產生公開金鑰私密金鑰對

[[email protected] /]#ssh-keygen -t rsa

系統在/root/.ssh下產生id_rsa、id_rsa.pub


③把A機下的id_rsa.pub發送到B、C機

[[email protected] /]#ssh-copy-id -i /root/.ssh/id_rsa.pub 10.139.8.83

[[email protected] /]#ssh-copy-id -i /root/.ssh/id_rsa.pub 10.139.8.84


二、B、C機採用步驟一中相同的方法,要記得改變ip地址


三、實現ssh多機互信

以A機為例

[[email protected] /]#ssh 10.139.8.83  //登入B機

[[email protected] /]#ifconfig //檢查是否成功登入

[[email protected] /]#exit //退出ssh登入,返回本機

本文出自 “11877272” 部落格,請務必保留此出處http://11887272.blog.51cto.com/11877272/1828587

Centos 7 下實現多虛擬機器互信

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.