Virtual Machine: xshell fails to connect to the Virtual Machine Ubuntu solution, xshellubuntu
When we can't afford a server, but want to simulate the server environment for learning, the best thing is to directly install a Linux virtual machine, which is very simple and fast!
First, you can use ifconfig-a to view the IP address of the Ubuntu Server (provided that you have set the network mode of the VM to Bridge to connect to the Internet | by default, the image system has just been installed on the VM, no operations are performed)
Next, use the Xshell tool to add the Virtual Machine IP address to the host column, and enter the Virtual Machine Login name and password in Login Prompts.
Problem:
After the basic Xshell is configured, the connection fails when you click Connect. (This is because your Ubuntu does not contain openssh-server)
Solution:
Sudo apt-get install openssh-server
After installation, check whether the service is started:
Ps-ef | grep ssh
If you see/usr/sbin/sshd-D, it indicates that the service has been started. Otherwise, the service has not been started.
Connect to Xshell again and you will find a successful connection!