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

相关文章
相关标签/搜索