简体   繁体   English

我无法在 VM 之间连接 ssh

[英]I can't connect ssh between VMs

I just tried to create 3 ubuntu VMs on Virtualbox.我刚刚尝试在 Virtualbox 上创建 3 个 ubuntu 虚拟机。 then I tried to connect each machine to another machine using ssh but it failed.然后我尝试使用 ssh 将每台机器连接到另一台机器,但失败了。

"I noticed that the 3 VMs has the same IP, So I made static IP to each machine" “我注意到这 3 个虚拟机具有相同的 IP,所以我为每台机器制作了 static IP”

So kindly find the below steps:所以请找到以下步骤:

$ sudo apt install ssh
$ sudo systemctl enable ssh
$ sudo systemctl start ssh
$ sudo ufw allow ssh
$ ssh username@ip

do a test of communication with these vms through ping.通过 ping 测试与这些 vm 的通信。

If the communication is ok your problem must be related to the firewall.如果通信正常,则您的问题必须与防火墙有关。

You can disable your linux environment's firewall temporarily to test if this is really the problem.您可以暂时禁用您的 linux 环境的防火墙,以测试这是否真的是问题所在。

If the problem is due to the firewall, you must create the release rule for a specific port.如果问题是由防火墙引起的,您必须为特定端口创建释放规则。 By default it is port 22.默认情况下,它是端口 22。

Test suggestion: Stop SELinux and FirewallD or any other firewall in your distribution and retest测试建议:停止发行版中的 SELinux 和 FirewallD 或任何其他防火墙并重新测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM