从头开始积累centos7系统运用

大牛博客:https://blog.51cto.com/yangrong/p5

1.关闭selinux功能:

SELinux(Securety-EnhancedLinux)是美国国家安全局(NSA)对于强制访问控制的实现,这个功能让系统管理员又爱又恨,

这里我们还是把它给关闭了吧,至于安全问题,后面通过其他手段来解决,这也是大多数生产环境的做法,如果非要开启也是可以的,

关闭方式如下:enforcing改成disabled

加 -i才是修改,不加只是查看。修改配置文件

sed 's#SELINUX=disabled#SELINUX=enforcing#g'  /etc/selinux/config

路径:

[root@python01 ~]# 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=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@python01 ~]# grep 'SELINUX=disabled' /etc/selinux/config
SELINUX=disabled
[root@python01 ~]# grep 'disabled' /etc/selinux/config         
#     disabled - No SELinux policy is loaded.
SELINUX=disabled

以上修改配置文件后selinux还是没有生效:

查看selinux状态:

[root@python01 ~]# getenforce
Disabled

[root@python01 ~]# setenforce
usage:  setenforce [ Enforcing | Permissive | 1 | 0 ]

仅仅开启警告:重启后生效

[root@python01 ~]#  setenforce 0

2.运行级别:

[root@python01 ~]# cat /etc/inittab
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
#
# To view current default target, run:
# systemctl get-default
#
# To set a default target, run:
# systemctl set-default TARGET.target
#

[root@python01 ~]# runlevel
N 5

[root@python01 ~]# systemctl get-default
graphical.target

3.关闭防火墙:

查看防火墙状态:systemctl status firewalld.service

关闭:systemctl stop firewalld

开启:systemctl start firewalld

开机自动关闭:systemctl disable firewalld

开机自动启动:systemctl enable firewalld

4.中文乱码:

[root@python01 ~]# cat /etc/locale.conf
#LANG="zh_CN.UTF-8"
LANG="en_US.UTF-8"

5.setup命令工具:没试过

yum install setuptool

yum install ntsysv

yum install iptables

yum install system-config-securitylevel-tui

yum install system-config-network-tui

6.见19 history命令

7.特殊变量设置:不用做到系统里面,知道就好了

[root@python01 ~]# echo 'export TOUT=300' >>/etc/profile

[root@python01 ~]# echo 'export HISTSIZE=5' >>/etc/profile

[root@python01 ~]# echo 'export HISTFILESIZE=5' >>/etc/profile

8.隐藏linux系统信息

清空以下文件内容即可

[root@python01 ~]# cat /etc/issue
\S
Kernel \r on an \m

[root@python01 ~]# cat /etc/issue.net
\S
Kernel \r on an \m

9.快照的概念:

可以还原系统到指定快照时间

10.克隆虚拟机:学习专用

以一台机为标准(快照):

22.centos7基础学习与积累-008-系统调优及安全设置的更多相关文章

  1. Linux系统调优及安全设置

    1.关闭SELinux #临时关闭 setenforce 0 #永久关闭 vim /etc/selinux/config SELINUX=disabled 2.设定运行级别为3 #设定运行级别 vim ...

  2. 20.centos7基础学习与积累-006-软实力-画图

    从头开始积累centos7系统运用 亿图是用指南 安装亿图软件 修改基础配置 路径:文件==>选项==>常规 需要修改的参数: 撤销次数:256 自动保存间隔:2分钟 路径:文件==> ...

  3. 17.centos7基础学习与积累-003-命令练习01

    1.从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 linux命令的学习: 创建目录:mkdir mkdir /data mkdir ...

  4. 26.centos7基础学习与积累-012-文件和目录的属性

    从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 1.文件的属性(文件的信息描述): [root@python01 ~]# ls -l ...

  5. 25.centos7基础学习与积累-011-课前考试二-命令练习

    从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 取IP地址: 6的命令:ifconfig eth0 7的命令 [root@pytho ...

  6. 24.centos7基础学习与积累-010-上机考核命令练习

    从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 1.创建目录/data/oldboy,并且在该目录下创建文件oldboy.txt,然 ...

  7. 21.centos7基础学习与积累-007-远程连接

    从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 IP地址: 互联网上的计算机 都会有一个唯一的32位的地址,ip地址,我们访问服务器 ...

  8. 19.centos7基础学习与积累-005-命令总结01

    从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 1.查看命令帮助的方法: --help 适用于一般命令,非内置命令 man  适用于 ...

  9. 18.centos7基础学习与积累-004-分区理论

    1.从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 1.常规分区:数据不是特别重要的业务(集群的某个节点) /boot  引导分区 ...

随机推荐

  1. (十二)springboot中shiro的使用

    一.引入maven配置 <dependency>     <groupId>org.apache.shiro</groupId>     <artifactI ...

  2. [转]java 根据模板文件生成word文档

    链接地址:https://blog.csdn.net/ai_0922/article/details/82773466

  3. npm 的一些命令

    查看项目中是否安装某个插件 npm [name] -v [name] 为要查询的插件的名字,如果已经安装就会显示该插件的版本号 npm list 查看项目中所有已安装的插件

  4. linux服务器之间文件传输

    有时候我们会遇到,把一个服务器上的文件夹,传到另一个服务器 我们需要先把文件夹打包成 tar.gz,这种格式在任何linux版本上都能压缩/解压 #解压命令 tar -zxvf xxx.tar.gz ...

  5. centos7如何将docker容器配置成开机自启动

    docker 服务器开机自启动: 1.systemctl is-enabled docker.service  检查服务是否开机启动 2.systemctl enable docker.service ...

  6. AIOps基本概念以及能力分级

    AIOps 自从 Gartner 于2016年提出至今已有一段时间,虽然在顶级互联网及电信企业,已有较多落地,但至今仍无基于生产实践的理论体系及实施指南. 高效运维社区和云计算开源产业联盟(OSCAR ...

  7. [转帖]java中的for循环

    java中的for循环 https://baijiahao.baidu.com/s?id=1621622990642364099&wfr=spider&for=pc 发现自己连 for ...

  8. mysql求中位数

    实例1: SET @ID = 0; SELECT AVG(loan_amount) from ( SELECT @ID:=@ID+1 as ID, loan_amount FROM   table_x ...

  9. day51——对象、BOM对象、DOM对象

    day51 JSON对象 var a = {'name':'太白','age':89}; 序列化:var b = JSON.stringify(a); 反序列化:var c = JSON.parse( ...

  10. STM32 EV1527无线通信(433)

    EV1527无线通信 先说一下这个通信协议的数据格式,这个图片是我在手册里截的. 大家按照单片机类型计算周期,我的是STM32f103vb (4CLK大致等于350um) 发送时按照 先发同步码后发D ...