1思灰、當(dāng)centos最小化安裝時(shí)玷犹,需要自己安裝所需要的安裝包、需要配置yum源洒疚;
1歹颓、掛載光盤;
# mount /dev/sr0 /mnt
# df ----查看光盤是否掛載油湖;
2巍扛、創(chuàng)建yum源;
#cd /etc/yum.repos.d/
#rm -rf * ----刪除當(dāng)前目錄下的原有的文件乏德,自己重新創(chuàng)建并編寫配置文件撤奸;
#vim /etc/yum.repo.d/base.repo
[base]
name=base
baseurl=file:///mnt
gpgcheck=0----不用輸入公鑰
#yum repolist
#yum makecache----創(chuàng)建元數(shù)據(jù)緩存;
3喊括、安裝autofs包胧瓜,以后啟動(dòng)光盤將自動(dòng)掛載到/misc/cd 目錄下;
centos7
#yum install autofs
#systemctl enable autofs----下次開機(jī)啟動(dòng)瘾晃;
#systemctl is-enabled autofs----查看是否生效贷痪;
#systemctl start autofs----啟動(dòng)服務(wù);
#cd /misc/cd----查看是否能進(jìn)入神奇的目錄蹦误;
centos6
#yum install autofs
#chkconfig autofs on----下次開機(jī)啟動(dòng)劫拢;
#chkconfig --list----查看是否生效肉津;
#service autofs start----開啟服務(wù);
#service autofs status----查看是否生效舱沧;
4妹沙、將yum源重新配置,更改為/misc/cd目錄下熟吏;
#cat>/etc/yum.repos.d/ <<EOF
[base]
name=base
baseurl=file:///misc/cd
gpgcheck=0
#yum repolist ----查看是否生效距糖;
5、yum查看安裝包的來源牵寺;
#yum makecache;
#yum info autofs----查看包是否安裝悍引;
#yum provides autofs----查看包來源;
#yum search autofs----查看包來源帽氓;
2趣斤、運(yùn)行一些服務(wù)時(shí)需要關(guān)閉防火墻,防火墻設(shè)置黎休;
1浓领、查看防火墻狀態(tài);
centos7
#iptables -nvL----查看防火墻狀態(tài)势腮;
#systemctl disable firewalld----下次開機(jī)關(guān)閉防火墻联贩;
#systemctl is-enabled firewalld----查看是否生效;
#systemctl stop firewalld----停止防火墻服務(wù)捎拯;
#systemctl status firewalld----查看防火墻狀態(tài)泪幌;
centos6
#iptables -nvL----查看防火墻狀態(tài);
#chkconfig iptables off----下次開機(jī)關(guān)閉防火墻署照;
#chkconfig --list----查看防火墻狀態(tài)座菠;
#service iptables stop----停止防火墻服務(wù);
#service iptables status----查看防火墻狀態(tài)藤树;
3浴滴、運(yùn)行一些服務(wù)時(shí)需更改SElinux配置文件;
1岁钓、查看SElinux當(dāng)前狀態(tài)升略;
#getenforce----查看當(dāng)前狀態(tài);
[root@centos6 ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2屡限、將SELINUX=enforcing更改為SELINUX=permissive;
#vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
3品嚣、# setenforce 0
4、查看當(dāng)前狀態(tài)钧大;
# getenforce
#systemctl (enable ,disable) option
#systemctl is-enabled option
#chkconfig option (on翰撑,off)
#chkconfig --list
#systemctl (start ,status,restart,stop ) option
#service option (start,status,restart,stop)