Detailed steps for xshell to connect to a virtual machine remotely (novice tutorial)

Recently, many people have sent me private messages to solve problems such as xshell connection errors and other issues.

Thank you for your continued attention. Xiaohe also spent the hot summer with you. Below I will make some measures specifically for the tutorial on connecting xshell to a remote virtual machine and the problems that arise when xshell connects to a virtual machine.

xshell remote connection tutorial

1. After we have installed xshell, we don’t know how to remotely connect to the virtual machine, etc.

2. We create a new session. The name can be arbitrary (I use the system name here for convenience of later use), but the IP address of the host is the IP address of the virtual machine that needs to be connected.

Note: If you don’t know the IP address you need to connect to, you can use ifconfig to check the IP address.

3. The next step is to connect to the virtual machine. The user name here must be the user name of the connected virtual machine.

4. The username and password of the connected virtual machine must match.

5. The remote connection is established

This connection can be successful under normal circumstances, but there are also some factors that may cause it to be unsuccessful. Below I will share some of the problems and solutions I encountered when connecting. For reference only.

Measures to solve the problem of xshell connecting to virtual machine

1. Let’s first check the questions returned to us by xshell. We can analyze the results returned in front of type. There is a problem with the reflected port and address.

When encountering this situation, we must first check whether our virtual machine is turned on. If not, turn it on. Try to see if the connection can be made. If the connection cannot be made, we can use the ifconfig command on the virtual machine to check if the IP address is incorrect.

2. If all the above steps are verified correctly and the IP address is correct, then it is the SSH port.

Log in as the super administrator and modify the /etc/ssh/sshd_config file. Command: vim /etc/ssh/sshd_config.

turn up:

# Authentication:

 #LoginGraceTime 2m

#PermitRootLogin prohibit-password

#StrictModes yes

Modify it:

# Authentication:

LoginGraceTime 2m

PermitRootLogin yes

StrictModes yes

Press Esc, enter the :wq command, save and exit.

Shut down the virtual machine and restart the virtual machine.

Enter the /etc/init.d/ssh restart command.

Finally, if you find it useful, just follow Xiaohe and let’s work together to fly towards our dreams.

 

Guess you like

Origin blog.csdn.net/weixin_55897008/article/details/126628056