过去两天我能够使用 Putty 连接到我的虚拟机:
但从今天早上起我得到了:
您知道什么会导致此错误以及如何消除它吗?IP 更改?
这个虚拟机是 Fedora,目前运行非常顺利。
这是我想要连接的 Fedora 机器的 ifconfig:
[ac@localmachine data-tools]$ ifconfig
br-4bcf98dfca2a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.29.0.1 netmask 255.255.0.0 broadcast 172.29.255.255
inet6 fe80::42:eff:fe64:a9fd prefixlen 64 scopeid 0x20<link>
ether 02:42:0e:64:a9:fd txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 02:42:0f:72:db:f7 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.153.128 netmask 255.255.255.0 broadcast 192.168.153.255
inet6 fe80::75d0:2219:7b3b:97c4 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c8:b8:02 txqueuelen 1000 (Ethernet)
RX packets 671764 bytes 836534330 (797.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 139028 bytes 17062558 (16.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 196184 bytes 31675520 (30.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 196184 bytes 31675520 (30.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth0d56971: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::605d:1eff:fe75:6bea prefixlen 64 scopeid 0x20<link>
ether 62:5d:1e:75:6b:ea txqueuelen 0 (Ethernet)
RX packets 86913 bytes 10046500 (9.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 87236 bytes 20449239 (19.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 52:54:00:71:e2:e8 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
是不是因为我需要将外部 TCP 端口 4662 重定向到本地机器上的端口 22?该怎么做?
我的防火墙已启动并正在运行。我关闭了所有防火墙,但问题仍然存在。
但即使我将它们全部删除,我仍然遇到同样的问题。
现在我想知道 SSH 服务器是否在 Fedora 上运行。因此我尝试:
root@localmachine ac]# sudo service httpd status
Redirecting to /bin/systemctl status httpd.service
○ httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor pr>
Active: inactive (dead)
Docs: man:httpd.service(8)
但似乎和SSH服务器没有关系,然后我尝试检查sshd进程是否正在运行:
[root@localmachine ac]# ps aux | grep sshd
root 5787 0.0 0.1 30536 6656 ? Ss Jul08 0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
root 48866 0.0 0.0 221528 788 pts/0 S+ 13:18 0:00 grep --color=auto sshd
你知道吗?这个 22 号港口:
[root@localmachine ac]# netstat -plant | grep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5787/sshd: /usr/sbi
tcp6 0 0 :::22 :::* LISTEN 5787/sshd: /usr/sbi
然后我尝试通过虚拟机端的防火墙解除破解:
systemctl disable firewalld;
但错误仍然存在。