启动配置


重置root用户密码

rd.break

mount
-o remount,rw /sysroot chroot /sysroot passwd touch /.autorelabel exit reboot

配置网卡信息

[root@localhost ~]# ifconfig

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eno16777728
BOOTPROTO=none
ONBOOT=yes
IPADDR0=192.168.10.10

[root@localhost ~]# systemctl restart network

[root@localhost ~]# ifconfig

[root@localhost ~]# nm-connection-editor

[root@localhost ~]# nmtui

[root@localhost ~]# ifconfig

挂载光盘

[root@localhost ~]# mkdir -p /media/cdrom

[root@localhost ~]# mount /dev/cdrom /media/cdrom

[root@localhost ~]# df -h

[root@localhost ~]# vim /etc/fstab
/dev/cdrom /media/cdrom iso9660 defaults 0 0

[root@localhost ~]# mount -a

[root@localhost ~]# blkid

[root@localhost ~]# lsblk

 配置本地Yum仓库

[root@localhost ~]# vim /etc/yum.repos.d/rhcsa.repo
[rhcsa]
name=rhcsa
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0

配置网络Yum仓库

下载对应版本 repo 文件, 放入 /etc/yum.repos.d/ (操作前请做好相应备份)

  • CentOS5 :http://mirrors.163.com/.help/CentOS5-Base-163.repo
  • CentOS6 :http://mirrors.163.com/.help/CentOS6-Base-163.repo
  • CentOS7 :http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@linuxprobe yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@linuxprobe yum.repos.d]# mv CentOS7-Base-163.repo CentOS-Base.repo 
[root@linuxprobe yum.repos.d]# vim CentOS-Base.repo 
 12 [base]
 13 name=CentOS-$7 - Base - 163.com
 14 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch    &repo=os
 15 baseurl=http://mirrors.163.com/centos/7/os/$basearch/
 16 gpgcheck=1
 17 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
 18 
 19 #released updates
 20 [updates]
 21 name=CentOS-$7 - Updates - 163.com
 22 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch    &repo=updates
 23 baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
 24 gpgcheck=1
 25 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
 26 
 27 #additional packages that may be useful
 28 [extras]
 29 name=CentOS-$7 - Extras - 163.com
 30 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch    &repo=extras
 31 baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
 32 gpgcheck=1
 33 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
 34 
 35 #additional packages that extend functionality of existing packages
 36 [centosplus]
 37 name=CentOS-$7 - Plus - 163.com
 38 baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
 39 gpgcheck=1
 40 enabled=0
 41 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

 普通用户添加sudo权限

[root@linuxprobe ~]# ll /etc/sudoers
-r--r-----. 1 root root 4000 Jan 15 2014 /etc/sudoers
[root@linuxprobe
~]# chmod u+w /etc/sudoers
[root@linuxprobe
~]# ll /etc/sudoers -rw-r-----. 1 root root 4000 Jan 15 2014 /etc/sudoers
[root@linuxprobe
~]# vim /etc/sudoers 99 linuxprobe ALL=(ALL) ALL
[root@linuxprobe
~]# chmod u-w /etc/sudoers
[root@linuxprobe
~]# ll /etc/sudoers -r--r-----. 1 root root 4028 Jan 11 13:27 /etc/sudoers
原文地址:https://www.cnblogs.com/dinghailong128/p/12115708.html