Virtual machine Operating system: Ubuntu 18
Physical machine Operating system: Windows 10
Software version: XSHELL5
Action page: Ubuntu under the terminal page +windows under the XSHELL5 page
Step one : View the IP address of Ubuntu in the virtual machine
Action page: Ubuntu's Terminal page
Instructions:
Ifconfig
The terminal will display the address of your virtual machine, where inet 192.xxx.x.xxx is the IP address of your virtual machine
[Email protected]:/etc/ssh# ifconfigens33:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> 192. xxx.x.xxxnetmask 2xx.xxx.xx5. 0 192. xxx.x.xxx
Step Two: Install the plugin with Xshell in Ubuntu; (in Administrator mode, follow the steps below.) )
directive: sudo apt install openssh-server
Step three: Enter the directory where the Sshd.config file is located;
Instructions:
Cd/etc/ssh
Step four : Configure the SSH-related files to ensure that you can log in as root in Xshell.
Instructions:
Gedit Sshd_config
Both of these methods are available. The following is an example of gedit editing. (Gedit safety)
Step five : In step four to bounce out of the interface, modify the red box part of the code; (Make sure your red-box code is consistent with the code in my Red-box section)
Remove the # in front of #StrictModes Yes
and add the following line of code before #StrictModes Yes:
Permitrootlogin Yes
then click Save.
After modification
Click Save and then exit.
Step Six: Restart the SSH service.
Action page: Or just the Ubuntu Terminal page
Instructions:
/etc/init.d/ssh restart
You can see the return:
o k ] Restarting SSH (via Systemctl): Ssh.service.
OK, so the preparation is done under the virtual machine Ubuntu, next to the Xshell page of WINDOWS10.
Step Seven: Open the WNDOWS10 under the Xshell, click "New";
Step Eight : Add the address of your virtual machine to the " host " in the pop-up interface;
Step nine: Click on the "User authentication" option. Modify your user's password. This password is the root password of your virtual machine Ubuntu. That is, each time you enter the terminal under the "SU" to type the password;
then click OK.
Succeeded: The last connection succeeded:
Conclusion: This method is more convenient than other methods on the net, and one step is in place.
Ubuntu18 systems that use XSHELL5 to connect virtual machines under Windows 10