从头开始积累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. 生成pcf文件

    import os import datetime import hashlib def checksum(filename): with open(filename, mode='rb') as f ...

  2. 远程控制分析之VBS编码转换

    简介 分析这种VBS简单chr()函数编码的脚本技巧.只需要把vbs的execute()函数换成信息输出到控制台(dos窗口)函数就可以了. WSH.Echo "print your mes ...

  3. 【视频开发】ONVIF、RTSP/RTP、FFMPEG的开发实录

    ONVIF.RTSP/RTP.FFMPEG的开发实录 前言 本文从零基础一步步实现ONVIF协议.RTSP/RTP协议获取IPC实时视频流.FFMPEG解码.开发环境为WIN7 32位 + VS201 ...

  4. ActiveMQ 安装方法

    1. 打开浏览器,访问网址 http://activemq.apache.org/components/classic/download/ ,下载最新的版本,当前最新版本为5.15.9,根据Activ ...

  5. redis单机多节点集群

    # ##安装Redis redis安装参考 https://www.cnblogs.com/renxixao/p/11442770.html Reids安装包里有个集群工具,要复制到/usr/loca ...

  6. linux端口映射

    参考文章: http://jingyan.baidu.com/article/ed15cb1b2a332e1be36981ed.html http://www.myhack58.com/Article ...

  7. WPF 程序鼠标在窗口之外的时候,控件拿到的鼠标位置在哪里?

    原文:WPF 程序鼠标在窗口之外的时候,控件拿到的鼠标位置在哪里? 在 WPF 程序中,我们有 Mouse.GetPosition(IInputElement relativeTo) 方法可以拿到鼠标 ...

  8. .NET 使用 ILRepack 合并多个程序集(替代 ILMerge),避免引入额外的依赖

    原文:.NET 使用 ILRepack 合并多个程序集(替代 ILMerge),避免引入额外的依赖 我们有多种工具可以将程序集合并成为一个.比如 ILMerge.Mono.Merge.前者不可定制.运 ...

  9. Excel 2010同时打开2个或多个独立窗口

    亲测有效 参考下面的网址 https://jingyan.baidu.com/article/86fae346acca7d3c49121ad4.html 1. 在win+r  输入框里面输入“rege ...

  10. Python进阶----数据库的基础,关系型数据库与非关系型数据库(No SQL:not only sql),mysql数据库语言基础(增删改查,权限设定)

    day37 一丶Python进阶----数据库的基础,mysql数据库语言基础(增删改查,权限设定) 什么是数据库:    简称:DataBase ---->DB    数据库即存放数据的仓库, ...