Linux CentOS7

CentOS7

1. On the ordinary user switching CentOS7 root, each switch

The current average user logged in, want to switch to the root user, you need to enter the command

su

Here Insert Picture Description
You need to enter the root password. When the input screen does not display, direct input finished, press Enter

After the transport, i.e. switch to the root user

Here Insert Picture Description
The user wants to switch from the root to the regular user, just type

su  用户名

Here Insert Picture Description
You can switch to the regular user! !

2.CentOS7 how to save and exit the vi editor

Save command

Press the ESC key to skip the command mode, then:

: W Save the file but do not quit vi

: W file will be saved to file in another modification, do not quit vi

:! W forced to save, do not quit vi

: Wq Save the file and exit vi

:! Wq forced to save the file and exit vi

q: do not save the file and exit vi

:! Q does not save the file, force quit vi

:! E to give up all the changes, starting with the last saved the file to edit

3.CentOS7 set about the network

Bottles CentOS7, we are not on the Internet beginning of

Here Insert Picture Description

At this time, you can enter the command dhclient, you can obtain an IP address automatically, and then view the command ip addr IP ( to switch to root user in the operating file )

Here Insert Picture Description

But this time acquired IP is dynamic, after the next reboot the system, IP address will change, this time we can set the system as a static IP is provided as follows:
(1) Click on the upper left corner of VMware virtual machines. " edit ", select" virtual network compiler. "
(2) Select VMnet8 (NAT mode), then click on the right side of the "NAT settings" at this time you will see the following interface

Here Insert Picture Description

(3) Input the command line: vim / etc / sysconfig / network-scripts / ifcfg-ens33

Here Insert Picture Description

(4) At this time will enter the following interface

Here Insert Picture Description

(5) The ONBOOT = no to yes, the BOOTPROTO = dhcp to BOOTPROTO = static, and adding a few lines after the content:
the IPADDR = 192.168.127.128
NETMASK = 255.255.255.0
the GATEWAY = 192.168.127.2
the DNS1 = 119.29.29.29

Here Insert Picture Description

(6) Save and exit, and then enter the command: systemctl restart network.service to restart the network services.

Here Insert Picture Description

(7) Check again ip addr IP, and communicates with the ping command to test the network.

Here Insert Picture Description

Thus, IP is now set.

Reprinted to:

https://www.cnblogs.com/sxdcgaq8080/p/10041435.html
https://blog.csdn.net/akipa11/article/details/81414875

Original articles published 0 · won praise 0 · Views 7

Guess you like

Origin blog.csdn.net/u013328965/article/details/103987144