When you connect in this way, you always connect to a virtual machine, and you are always prompted could not connect to
On the internet to find a half-day data only found because my virtual machine does not have the SSH service caused by
To solve this problem:
To install the Openssh-server first, install it with the following command if it is not installed:
sudo apt-get install Openssh-server
Then check if SSH is started with the following command:
Ps-e | grep ssh
If only ssh-agent indicates that it is not started, you need to
/etc/init.d/ssh start.
Once you have done this, use Xshell to connect to the virtual machine again, and then eject this
Then the interface of the Xshell virtual machine appears
This situation occurs because SSH does not allow the root account to log on remotely
The workaround is: Modify the SSH configuration file/etc/ssh/sshd_config
Modify Vim/etc/ssh/sshd_config
Find # Authentication:
Logingracetime 120
Permitrootlogin without passwd
Strictmodes Yes
Change into
# Authentication:
Logingracetime 120
Permitrootlogin Yes
Strictmodes Yes
But only if you need to log in with the root account to modify it, or it will show ' readonly ' option is set (add! To override)
Log in to the root account using Su-root, and then make changes
If the root user is not configured, use sudo passwd root to enter the password as prompted, and then log on for the operation.
After the modification is complete:
First press ESC to return to command mode;
VI Save the file has different options, corresponding to different commands, you can choose from the following command to a need;
: w save file but do not exit VI
: W file saves the modification to file and does not exit VI
: w! Force save, do not exit VI
: Wq save file and Exit VI
: wq! Force the file to be saved and exit VI
: Q Do not save file, Exit VI
: q! do not save file, Force exit VI
: e! Discard all modifications
Finally, using Xshell to log in to the virtual machine is OK.
A dream ...