VM virtual machine Linux development environment to build basic settings

table of Contents

Description 

Modify hostname

Configure network card

Add mapping

Turn off firewall

 Set up password-free


Description 

The host names and IP addresses of the three machines

shi1 192.168.81.140

shi2 192.168.81.150

shi3 192.168.81.160

ISO image file

CentOS-7-x86_64-DVD-2003.iso

Modify the host name (the same operation on three machines)

 Use the following command to modify the host name. After modifying the host name, enter the reboot command to restart the virtual machine to make the host name effective

vi /etc/hostnama

Configure the network card (the same operation for three machines)

First use the vi /etc/sysconfig/network-scripts/ifcfg-ens33 command to enter the edit network card interface and change the no of ONBOOT to yes , then save and exit, and then use the service network restart  command to restart the network card to view the network of the assigned local IP address Segment (how to see in the picture below), mine is 192.168.81.***

After checking, operate according to the figure below, pay attention to modify the IP address network segment

Add mapping (the same operation on three machines)

Use the following command to enter the mapping

vi /etc/hosts

Add content

192.168.81.140 shi1
192.168.81.150 shi2
192.168.81.160 shi3

Turn off the firewall (the same operation on three machines)

Follow the picture to enter the command

 Set up password-free (the same operation for three machines)

Generate a key pair, after generation, go to the second machine for operation, and then go to the third machine for operation

 

After the three machines have generated a key pair, they are connected to the three machines, and each machine must be operated

 

Guess you like

Origin blog.csdn.net/qq_38774450/article/details/109229252