Xshell connects to the virtual machine on VMware

Xshell connects to the virtual machine on VMware

documents required

The CentOS mirror I use is the mirror on the open source mirror site of Nanjing University

Xshell is a free version that can be downloaded from the official website

step:

1. Check the network connection mode of the Linux virtual machine to make sure it is NAT mode.

image-20220926181512707

2. On the VMware interface, click Edit option—[Virtual Network Editor], select VMnet8 (NAT mode), uncheck [Use local DHCP service], if DHCP service is used, IP will be dynamically assigned

image-20220926181836132

3. After setting, click NAT setting.

image-20220926182048631

192.168.22.0 represents the network segment IP, 255.255.255.0 represents the subnet mask, and 192.168.22.2 is the gateway address. We cannot use the addresses 0 and 2 when setting the IP of the virtual machine.

4. Set the virtual machine IP, gateway, DNS and host name.

If you don't know vim, refer to the common shortcut keys of VIM , which is summarized in detail.

image-20220926184917637

1) Set the IP address, subnet mask and gateway.

vim /etc/sysconfig/network-scripts/ifcfg-ens33

image-20220926183049842

BOOTPROTO=static //The network allocation method is static
IPADDR=192.168.22.3 //The set IP address
NETMASK=255.255.255.0 //Subnet mask
GATEWAY=192.168.22.2 //Gateway
ONBOOT=yes //Indicates whether the system starts Activate network card

2) Set DNS

vim /etc/resolv.conf

image-20220926183836844

3) Set the hostname

vim /etc/sysconfig/network

image-20220926184013614

NETWORKING=yes
HOSTNAME=Coo01

vim /etc/hostname

image-20220926184336195

4) After the file configuration is complete, restart the virtual machine.

service network restartrestart network card

rebootRestart the virtual machine

5. Set the IP properties of VMnet8 on Windows.

Right-click and select Personalization, select [Network and Internet], click the advanced network settings below, and select [More network adapter options]

image-20220926185836199

6. After configuring the above steps, you can successfully use Xshell to connect to the Linux virtual machine.

image-20220926190201066

Click Connect, enter the user name and password to connect.

image-20220926190318506

Guess you like

Origin blog.csdn.net/h_adam/article/details/127058954