LINUX平常操做二

參見:Linux平常操做一html

 selinux 開啓和關閉linux

1、查看SELinux狀態:
一、/usr/sbin/sestatus -v      ##若是SELinux status參數爲enabled即爲開啓狀態
SELinux status:                 enabled
二、getenforce                 ##也能夠用這個命令檢查
2、關閉SELinux:
一、臨時關閉(不用重啓機器):
setenforce 0                  ##設置SELinux 成爲permissive模式
                                     ##setenforce 1 設置SELinux 成爲enforcing模式
二、修改配置文件須要重啓機器:
修改/etc/selinux/config 文件
將SELINUX=enforcing改成SELINUX=disabled
重啓機器便可
centos

打開和關閉Swap服務器

一、關閉SWAPcurl

通常用於大物理內存的服務器ui

swapoff -a

執行以上命令,則能夠關閉SWAP分區。阿里雲

二、開啓SWAPurl

swapon -a

執行以上命令,則能夠開啓SWAP分區。centos7

3.永久關閉swapspa

sed -ri 's/.*swap.*/#&/' /etc/fstab

ntp集羣服務器時間同步

參考:http://www.javashuo.com/article/p-frrktgnv-gd.html

 防火牆的關閉與中止

systemctl stop firewalld.service
systemctl disable firewalld.service

 centos7使用阿里雲的yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backupcurl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repoyum clean allyum makecacheyum update

相關文章
相關標籤/搜索