?
1) Operating system installation
RHEL7 is a one-stop installation
?
2) NIC configuration file
RHEL6:/etc/sysconfig/network-scripts/ifcfg-eth0
RHEL7:/etc/sysconfig/network-scripts/ifcfg-eno16777736
?
RHEL6 Network Configuration
Static settings
Vi? /etc/sysconfig/network-scripts/ifcfg-eth0??? #编辑配置文件, add modify the following
Device=eth0 NIC Name
Bootproto=static??? #启用静态IP地址
Type=ethernet
Uuid= "a106d20f-65c2-4f17-a1a5-7311094fca7b"
Onboot=yes?? #开启自动启用网络连接
ipaddr=192.168.1.63? #设置IP地址
netmask=255.255.255.0?? #设置子网掩码
gateway=192.168.1.1??? #设置网关
dns1=8.8.8.8? #设置主DNS
dns2=8.8.4.4? #设置备DNS
: Wq!?? #保存退出
Service network restart?? #重启网络连接
Dynamic Network settings:
Device=eth0
Bootproto=dhcp
Type=ethernet
Hwaddr= a106d20f-65c2-4f17-a1a5-7311094fca7b (Nic mac address, do not change)
Onboot=yes (boot from boot)
?
3) Host name configuration file
Rhel6:/etc/sysconfig/network
Rhel7:/etc/hostname
Hostname is a kernel parameter under Linux, it is saved under/proc/sys/kernel/hostname, but its value is read from Rc.sysinit when Linux starts.
Theoretically/etc/sysconfig/network is a hostname configuration file that needs to be restarted and the system reads the hostname from the kernel when it restarts.
?
How to make changes take effect immediately without restarting
?
After modifying the hostname under/etc/sysconfig/network, then use the Sysctl kernel.hostname command to make it effective immediately
Vi/etc/sysconfig/network modifying hostname
After you change the command to view the discovery is not immediately effective
[Email protected] ~]# hostname
Xuegod63
Make it effective with an order
[Email protected] ~]# sysctl kernel.hostname=xuegod63.cn
Kernel.hostname = xuegod63.cn
[Email protected] ~]# hostname
xuegod63.cn, this change is successful.
?
4) Modify the IP address
Rhel6:setup or modify the NIC configuration file
Rhel7:nmtui or modify the NIC configuration file
Rhel6
?
#setup
?
?
5) service start-up and boot automatically
Rhel6:service Service Name Restart | Reload | Start | Stop | Status
Rhel7:systemctl Restart | Start | Stop | Status Service Name
?
Boot up
Rhel6:chkconfig Service Name on | Off
Rhel7:systemctl Enable | Disable service Name
?
Check if the service is booting
Rhel6:chkconfig--list Service Name
Rhel7:systemctl is-enabled Service Name
?
Rhel6
[Email protected] ~]# chkconfig sshd--list
Sshd???? 0: Close???? 1: Close???? 2: Enable???? 3: Enable???? 4: Enable???? 5: Enable???? 6: Off
?
6) Set the start level
Rhel6:vim/etc/inittab
# 1-single User mode
# 2-multiuser, without NFS (the same as 3, if you don't have networking)
# 3-full Multiuser mode
# 4-unused
# 5-x11
# 6-reboot (do not set Initdefault to this)
25 #
Id:5:initdefault://5 is the current start level, then change 5 to 3 (third boot level)
After the change is: "id:3:initdefault:".
: wq!
?
Restart Linux. Restart the server. After the reboot is complete, go to the command line interface and prompt for the user name and password.
Rhel7:systemctl Set-default Graphical.target (fifth start-up sector) | Multi-user.target (third boot level)
?
Switching mode:
Rhel6:init 3 | 5
Rhel7:systemctl Isolate Graphical.target (fifth start-up sector) | Multi-user.target (third boot level)
?
Viewing the startup level
Rhel6:runlevel
?
[Email protected] ~]# RunLevel
3 5
?
Rhel7:systemctl Get-default
?
7) Firewall Service name
Rhel6:iptables
Rhel7:firewalld
?
Rhel 6
Iptables–f
Shut down
/etc/rc.d/init.d/iptables stop
Open
/etc/rc.d/init.d/iptables start
?
View current configuration: Iptables–l
View the current status of the Firewall service iptables status
[[Email protected] ~]# service iptables stop
Iptables: Clear Firewall rule: [OK]
Iptables: Set the chain to policy accept:filter [OK]
Iptables: Uninstalling module: [OK]
[[Email protected] ~]# service iptables status
Iptables: Firewall is not running.
?
8) Common User UID
rhel6:500 start
[[email protected] ~]# ID Top
uid=500 (top) gid=501 (top) group =501 (top)
rhel7:1000 start
?
9) restore root password
RHEL6: In single-user mode
?
When the system boot screen appears, press "E" key to enter edit mode.
?
Press E
Add 1 on the last side
Are you sure
Press B to restart
Enter the single-user mode, you can change the password directly
RHEL7: In emergency mode
?
10) file System
Rhel6:ext4
Rhel7:xfs
?
11) Format the partition
RHEL6:mkfs.ext4
Mkfs.ext3/dev/sda5? Formatting/dev/sda5
RHEL7:mkfs.xfs
?
12) View Block
Rhel6:tune2fs-l/dev/sda1 | grep Size–color
rhel7:xfs_info/dev/sda1 | grep size
?
13) The first process to start
Rhel6:init
Rhel7:systemd
?
?
Build an experimental environment:
?
- Shutting down the firewall
Iptables–f
?
- Turn off SELinux
[Email protected] ~]# Getenforce
Enforcing
[Email protected] ~]# Setenforce 0
- With Yum
?
?
Configure local Yum Source
Cd/etc/yum.repos.d/??? #进入yum配置目录
Touch? Rhel-media.repo??? #建立yum配置文件
Vi? Rhel-media.repo??? #编辑配置文件, add the following
[Rhel-media]
name=red Hat Enterprise Linux 6.5??? #自定义名称
Baseurl=file:///media/cdrom? #本地光盘挂载路径
Enabled=1??? #启用yum源, 0 is not enabled, 1 is enabled
Gpgcheck=1?? #检查GPG-key,0 for no check, 1 for inspection
Gpgkey=file:///media/cdrom/rpm-gpg-key-redhat-release??? #GPG-key path (can not be written)
: wq!? #保存退出
?
Instance:
[Rhel-source]
Name=test
Baseurl=file:///mnt/test
Enabled=1
Gpgcheck=0
?
?
Set up automatic mount system image file on boot
Vi/etc/fstab??? #添加以下代码. Enable automatic mount on boot
/usr/local/src/rhel-server-6.5-x86_64-dvd.iso? /media/cdrom?? Iso9660??? Defaults,ro,loop? 0 0 real-computer under
/dev/cdrom/media/cdrom iso9660 defaults, ro,loop 0 0
: wq!? #保存退出
/dev/cdrom/media/cdrom ext3 defaults 0 0
| |
Your CD-ROM device mount point mount format default default
?
- Configure IP
- Configure hostname
?
?
?
?
?
?
?
The difference between RHEL6.5 and RHEL7 Rhel6.5 experimental environment construction