finalshell reports error when connecting to VM virtual machine, java,net.ConnectException: Connection timed out: connect

Applicable to all third-party error reports when connecting to virtual machines.

java,net.ConnectException: Connection timed out: connect

Xshell or something.

Solution:

First, I want to confirm that the finalshell software has been installed and the CentOS 7 server to be connected has been set up. There are many reasons for the problem of not being able to connect. Here are some suggestions to help you troubleshoot the problem:

  1. Make sure the CentOS 7 server is up and running. You can ping the server's IP address locally via the command line to check network connectivity. For example, input ping 服务器IP, if a response can be received, it means that the network is connected.

  2. Check whether your CentOS 7 server has the SSH service installed and running. Execute the following command on the server to view the status of the SSH service:

  3. sudo systemctl status sshd
    

    If the SSH service is not running, you can start it using the following command:

    sudo systemctl start sshd
    

    If the SSH service is not installed, you can install and start it using the following commands:

    sudo yum install -y openssh-server
    sudo systemctl start sshd
    sudo systemctl enable sshd

    Make sure your CentOS 7 server firewall allows SSH connections. Execute the following command to check the firewall rules:

4. Check your connection settings in finalshell software. Confirm that the IP address, port (default is 22), username and password you entered are correct.

5. If your CentOS 7 server is on a cloud service provider (such as AWS, Alibaba Cloud, etc.), please ensure that SSH connections are allowed in the security group or network ACL.

Here is my error: Microsoft Windows [Version 10.0.19044.2728] (c) Microsoft Corporation. all rights reserved. C:\WINDOWS\system32>ping 192.168.101.65 Pinging 192.168.101.65 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 192.168.101.65: Packets: Sent = 4, Received = 0, Lost = 4 (100% lost), C:\WINDOWS\system32>

Enter via local computer cmd: Ping 192.168.101.65,

It is found that the centos7 server cannot be connected, please explain. The two addresses are not connected.

From the information you provided, you encountered a request timeout problem when trying to ping the server, indicating that there is a network connection problem between your computer and the server. Please try the following methods to troubleshoot the issue:

  1. Make sure your computer is on the same LAN as the CentOS 7 server. Please check whether the IP addresses of the two devices are in the same network segment, such as 192.168.101.x.

  2. Check whether network devices (such as routers, switches, etc.) are working properly. If possible, you can try restarting the network device.

  3. Make sure the server's IP address has not changed. If your server is not configured with a static IP address, its IP address may change. ip addrYou can execute the or command on the server ifconfigto view the current IP address.

  4. Check whether your computer's firewall is blocking network connections to the server. You can temporarily turn off the firewall and then try to ping the server again. If this resolves the issue, you will need to allow communication with the server in your firewall settings.

  5. Make sure your computer does not have a VPN or proxy service enabled, as these services may affect your network connection.

If none of the above resolves the issue, please provide more details so we can further analyze the issue.

Under the Windows operating system, you can query your computer's IP address through the following methods:

  1. Open Command Prompt, which you can do by clicking on the Start Menu, then typing cmdand pressing Enter.

  2. In the Command Prompt window, enter the following command and press Enter:

     

    ipconfig

  3. After the command is executed, you will see information related to your network adapter. Look for the line called "IPv4 Address" with your computer's IP address right after it. For example:
    以太网适配器 以太网:
    
       连接特定的 DNS 后缀 . . . . . . . :
       本地链接 IPv6 地址 . . . . . . . . : fe80::b5d5:5f34:8d3b:3c9e%5
       IPv4 地址  . . . . . . . . . . . . : 192.168.1.100
       子网掩码  . . . . . . . . . . . . : 255.255.255.0
       默认网关. . . . . . . . . . . . . : 192.168.1.1

    In this example, the computer's IPv4 address is 192.168.1.100. Note that your computer may have multiple network adapters (such as wired network cards, wireless network cards, etc.). Please choose the appropriate IP address based on the actual situation.

  4. Based on the output you provided ipconfig, you have multiple network adapters on your computer. Among them, the IPv4 address of the Ethernet adapter (Ethernet) is 192.168.0.106, the subnet mask is 255.255.255.0, and the default gateway is 192.168.0.1. Your computer and server may be on different subnets. The server you are trying to connect to has an IP address of 192.168.101.65, which is not on the same subnet as your computer's IP address.

    To resolve this issue you can:

  5. Confirm that your computer and server are connected to the same network device (such as a router, switch, etc.) and that their subnets are set correctly. Depending on your needs, you may need to configure both devices with IP addresses on the same subnet. For example, change the computer's IP address to 192.168.101.x (x is any number between 1 and 254, but it cannot conflict with the server's IP address). (The most important thing is that the local IP and the first three IP addresses of this virtual machine must be the same)

  6. If your computer and server are connected through a router, check the router's settings to make sure it allows communication between different subnets and that routing rules are configured correctly.

  7. If your computer and server are on different physical networks, you may need to set up a VPN or use methods such as port forwarding to establish communication between the two networks. In this case, it is recommended that you consult your network administrator or relevant professionals for help.

It is recommended to modify the network address of centos7 directly, as follows

 

To change your server’s IP address on CentOS 7, follow these steps:

  1. First, log in to your CentOS 7 server via SSH or directly.

  2. Determine the name of the network interface you want to configure. You can view all available network interfaces using the following command:

nmcli device status

Typically, Ethernet interfaces are named eth0, enp0s3or something similar

Find your network interface configuration file. Normally, the configuration file is located /etc/sysconfig/network-scripts/in a directory and the file name format is ifcfg-接口名称, for example ifcfg-eth0. Open the configuration file using a text editor such as vior nano:

sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
  1. In the configuration file, find the following settings and change them as needed:

    • BOOTPROTO: Change this value to static, indicating that you want to manually assign an IP address.
    • ONBOOT: Change this value to yesto activate the network interface on startup.
    • IPADDR:Change this value to the new IP address you wish to assign to the server, 192.168.101.xe.g.
    • NETMASK: Change this value to your subnet mask, usually 255.255.255.0.
    • GATEWAY: Change this value to your network's default gateway address, for example 192.168.101.1.

    If the above settings do not exist, add them manually.

  2. Save and close the configuration file.

  3. Restart the network service for the changes to take effect

    sudo systemctl restart network
    

  4. Use the ip addror ifconfigcommand to check whether the new IP address has taken effect.

  5. Now you have changed your server's IP address. Make sure your computer and server are on the same subnet so they can communicate properly.

After the modification is completed, use finalshell to set your modified centos7 port. Just log in directly.

Finally, to sum up, the failure to connect is nothing more than a few situations.

The server firewall is turned on.

Check if your CentOS 7 server has the SSH service installed and running

The computer is in the same LAN as the CentOS 7 server. Please check whether the IP addresses of the two devices are in the same network segment, such as 192.168.101.x.

Probably the above three. Follow the steps to check, there must be no problem

Guess you like

Origin blog.csdn.net/weixin_56762231/article/details/130084913