Xshell accesses local or remote Linux virtual machines

background

VMware workstation and Ubuntu systems are installed on the local PC, but each time you access the virtual machine, you need to enter the login password, which is inconvenient. To this end, access the virtual machine through Xshell to improve work efficiency.

step

1. Open the virtual machine, enter the teminal terminal, enter the command ifconfig, and check the IP address of the virtual machine, as shown in the following figure:

2. Open Xshell, click File -> New or shortcut key (Ctrl + Alt + N), as shown in the following figure:

3. Fill in the name casually (according to personal habits or preferences), fill in the IP of the virtual machine (IP in step 1) for the host, and then click Connect;

problem and solution

However, Xshell does not appear to let us enter the user name and password for logging in to the virtual machine. . Instead, the following interface appears:

What's going on? After consulting the data, it is found that the breakthrough point of this problem is whether the linux system has started the ssh service , and then enter the linux terminal to check the status of the ssh service, as shown in the following figure:

The status indicates that the ssh service is not started, and then use the service sshd start command to start the ssh service:

The problem in the above picture is that the Linux system does not have ssh installed. You need to install it first with the following command to install ssh:

apt-get install openssh-server openssh-client

If the above command has insufficient permissions, use the following command:

sudo apt-get install openssh-server openssh-client

Note: In fact, you can check whether the service exists before starting the service:

ps -e | grep sshd

Finally, the ssh service is started in linux, as shown in the following figure:

Next, we can happily connect and use our virtual machine in Xshell:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324849159&siteId=291194637