Sharing the operation process of using xshell to connect to the virtual machine Ubuntu system

  1. Download xshell6 from the netsarang official website (https://www.netsarang.com/zh/xshell/), you can use the non-commercial version, you need to provide your personal email address, and download it through the download link sent.

  2. Install and start xshell6

  3. Create a new session, set the name (such as virtual machine linux), the protocol is SSH, the host is set to the IP address of the virtual machine terminal (use the ip -a command to query the IP address on the Ubuntu terminal), and the port number is 22 by default

  4. User authentication Enter the user name and password of the virtual machine terminal, and click Connect after completion.

  5. Indicates that the connection failed, and troubleshoot the problem.

  6. Enter sudo su in the virtual machine terminal to switch the user to root, and then follow the system prompts to enter the password (sudo means to execute as a root super administrator)

  7. Execute sudo apt-get install vim (newly installed Ubuntu needs to install vim), the system will install according to the instructions

  8. Execute sudo apt-get install openssh-server to install ssh service (remote connection is mainly used for this function), and the system will install according to the instructions

  9. Execute netstat -ntlp|grep 22 to check whether port 22 is enabled, and the system prompts Command 'netstat' not found, but can be installed with:

  10. Execute apt install net-tools to install the net-tools network configuration tool

  11. Execute netstat -ntlp|grep 22 again successfully, port 22 has been opened

  12. Execute sudo apt-get install ufw to install and configure the Ubuntu firewall (apt-get is a package management tool for Ubuntu)

  13. Execute sudo ufw enable to enable the Ubuntu firewall

  14. Execute sudo ufw allow 22 to allow external IP addresses to access port 22 of the machine

  15. Try to connect to the xshell session again, and the connection is successful

The above is a bit of personal experience sharing. If there is something wrong, please criticize and correct me~

Guess you like

Origin blog.csdn.net/zzong2020/article/details/108237401