22.centos7基础学习与积累-008-系统调优及安全设置
从头开始积累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.克隆虚拟机:学习专用
以一台机为标准(快照):
最新文章
- 织梦cms更新新建的栏目提示:DedeTag Engine Create File False:C:/phpStudy/WWW/
- jsonp解决跨域
- 答:SQLServer DBA 三十问之二:系统DB有哪些,都有什么作用,需不需要做备份,为什么;损坏了如何做还原(主要是master库)
- 56. Android中进程优先级小结
- 菜鸟学WEB开发 ASP.NET 5.0 1.0
- linux sar 命令详解
- 如何往IE工具条添加按钮(转载)
- Linux07--Shell程序设计03 通配符与正则表达式
- 再见,CSDN
- iOS上new Date异常解决办法
- SpagoBi开发示例——员工离职人数统计
- JS &; JQuery 动态处理select option
- python下彻底解决浏览器多窗口打开与切换问题
- Shell批量启动、关闭tomcat
- HTTP协议的请求与响应和CSS属性和定位
- TCP为什么是三次握手,为什么不是两次或者四次 &;&; TCP四次挥手
- Js下载文件到本地(兼容多浏览器)
- 使用IDEA工具配置和运行vue项目(详细其中的坑)
- JavaWeb基础—Servlet重要对象
- Direct2D处理几何图形之间的碰撞检测(下)
热门文章
- CentOS7下Redis的安装与使用
- Python - Django - 中间件 process_template_response
- python os.popen('xxx.py') 遇到的坑 (No Child Processes)
- eclipse 中的注释 快捷键 多行注释快捷键 单行注释快捷键
- Selenium-PO设计模式
- C# COM组的开发以及调用
- BottomTabNavigator 顶部导航的显示隐藏
- C#中的ref和out与SQL中的output
- Java生成艺术二维码也可以很简单
- strace调试工具编译移植