我是 SSH 新手,已成功从本地计算机通过 SSH 连接到本地虚拟机
现在我正尝试通过 SSH 连接到由远程机器托管的 VM。
错误如下:
vm@vm1-VirtualBox:~$ ssh [email protected].***.**
ssh: connect to host 192.168.***.** port 22: Connection timed out
以下是我尝试过的:
sudo ufw allow 22
sudo systemctl enable ssh
本地计算机和远程 VM 都有客户端和主机 ssh,我尝试将本地连接到远程 VM 以及反之亦然。
我发现一件奇怪的事情是 ping 不起作用,我尝试 ping 另一台机器ping <IP>
但它返回:
ping 192.168.**.*
PING 192.168.**.* (192.168.**.*) 56(84) bytes of data.
^C
--- 192.168.**.* ping statistics ---
10 packets transmitted, 0 received, 100% packet loss, time 9198ms
并service ssh status
返回:
ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: e>
Active: active (running) since Thu 2022-11-10 01:59:30 +08; 39min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 16543 (sshd)
Tasks: 1 (limit: 9319)
Memory: 1.8M
CPU: 44ms
CGroup: /system.slice/ssh.service
└─16543 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
Nov 10 01:59:29 Ubuntu-X550CC systemd[1]: Starting OpenBSD Secure Shell server.>
Nov 10 01:59:30 Ubuntu-X550CC sshd[16543]: Server listening on 0.0.0.0 port 22.
Nov 10 01:59:30 Ubuntu-X550CC sshd[16543]: Server listening on :: port 22.
Nov 10 01:59:30 Ubuntu-X550CC systemd[1]: Started OpenBSD Secure Shell server.
检查了我的 IP 和用户名
我哪里可能做错了?