Configuration (a) My Big Data learning road --centos7 system

Reference has changes: https: //blog.csdn.net/kuangjunhong/article/details/84321172

1. Installation mirror (centos7) (download the image: http://mirrors.aliyun.com/centos/7.7.1908/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso )

During installation: a single virtual disk storage file (copy convenience, a plurality of dump file may leak), a network network selected nat

1, install vim

yum -y install vim (use vim)

2, install net-tools

yum -y install net-tools (can use the ifconfig)

3, set a static ip

Edit - Virtual Network Editor ---- nat View network gateway

Use vi / vim editor to view and edit the network configuration file

命令:vim /etc/sysconfig/network-scripts/ifcfg-ens33

Note: This configuration file name is ifcfg-ens33 [] other environments may not be called this name

    ONBOOT = yes # boot automatically enable network connection
    IPADDR = 192.168.204.10 # static ip address
    NETMASK = 255.255.255.0 # Set the subnet mask
    GATEWAY = 192.168.204.2 # Set Gateway (Gateway review steps, vmware workstation == "edit == "virtual network editor ==" point VMnet8 mode == "the NAT setting ==" gateway the IP)
    the DNS1 = 119.29.29.29 # set the primary DNS
    DNS2 = 210.2.4.8 secondary DNS setting #

The original file amended as follows:

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

TYPE=Ethernet

BROSWER_ONLY=yes

BOOTPROTO=static

IPADDR=192.168.136.10

NETMASK=255.255.255.0

GATEWAY=192.168.136.2

DNS1=1.2.4.8

DNS2=210.2.4.8

IPV6INIT=no

NAME=ens33

UUID=

BDEVICE=ens33

ONBOOT=yes   

 
Restart card: systemctl restart network
check network: curl www.baidu.com

 
supplement:

In switching the user terminal CentOS 7 open terminal, represented by the command line begins with $ is for the user mode, the user wants to switch to the root authority (command # beginning of the line), as follows:

1. Input the command line: su - [- separated by a space between a user name User name su

    For example: su - root

2. Press Enter, enter the password for the user login, you can proceed to the next root user mode.

 

 
4, firewall

CentOS 7.0 is the default firewall as a firewall

Check firewall status

[firewall-cmd --state foregoing two state "-"]

Stop firewall [temporary]

systemctl stop firewalld.service

Prohibit firewall boot [permanent]

systemctl disable firewalld.service

 
supplement:

If iptables-service installation, the following commands may be used,

Installation: yum install -y iptables-services

// turn off the firewall

service iptables stop

// Check the firewall status

service iptables status

 
5、SELinux

Security-Enhanced Linux (Security-Enhanced Linux) referred to SELinux

selinux NASA proposed purpose is to reinforce security system, many of the details, you just put it off temporarily on the line

View

[root@dev-server ~]# getenforce

Disabled

[Root @ dev-server ~] # / usr / sbin / sestatus -v

SELinux status: disabled

Temporarily closed

## Set SELinux to be permissive mode

## setenforce 1 is set to become SELinux in enforcing mode

setenforce 0

Permanently closed

vim /etc/selinux/config

The SELINUX = enforcing changed SELINUX = disabled

After setting need to restart to take effect
restart the virtual machine: reboot

 

Released five original articles · won praise 3 · Views 1543

Guess you like

Origin blog.csdn.net/jk_wan_sui/article/details/101387417