9.28 linux系统基础优化
- 关闭SELinux(是美国安全局对强制访问的实现)功能
[root@wen ~]# sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config #使用sed + i 命令修改
[root@wen ~]# grep "SELINUX=disabled" /etc/selinux/config #grep查看
SELINUX=disabled
[root@wen ~]# 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 these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
以上重启生效,生产环境不能重启 用以下命令不用重启
[root@wen ~]# getenforce
Enforcing
[root@wen ~]# setenforce
usage: setenforce [ Enforcing | Permissive | | ]
[root@wen ~]# setenforce
[root@wen ~]# getenforce
Permissive
- 运行级别
[root@wen ~]# cat /etc/inittab
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(), init(), and initctl().
#
# Default runlevel. The runlevels used are:
# - halt (Do NOT set initdefault to this)
# - Single user mode
# - Multiuser, without NFS (The same as , if you do not have networking)
# - Full multiuser mode
# - unused
# - X11 #桌面
# - reboot (Do NOT set initdefault to this)
#
id::initdefault: [root@wen ~]# grep :initdefault /etc/inittab #调整运行级别,默认3,可以调成其他
id::initdefault:
[root@wen ~]# runlevel #查看当前级别
N
[root@wen ~]# init #切换运行级别
- 关机
shutdown(halt) init0
参数
-r reboot after shutdown
-h halt or power off after shutdown shutdown -h #10分钟后关闭
shutdown now #马上
poweroff #关闭电源 *关闭防火墙
[root@wen ~]# /etc/init.d/iptables stop #临时关闭
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
[root@wen ~]# /etc/init.d/iptables status #查看状态
iptables:未运行防火墙。
[root@wen ~]# /etc/init.d/iptables restart # 重启防火墙
iptables:应用防火墙规则: [确定]
[root@wen ~]# chkconfig iptables off #开机也不启动了
- linux中文显示设置等
*中文显示设置
[root@wen ~]# echo 'LANG="zh_CN.UTF-8“‘ > /etc/sysconfig/i18n
[root@wen ~]# cat /etc/sysconfig/i18n
LANG="zh_CN.UTF-8“
[root@wen ~]# echo $LANG
zh_CN.UTF-
同时调整ssh客户端 *设置账号超时时间
[root@wen ~]# export TMOUT= #5秒后关机 (临时生效)
[root@wen ~]# timed out waiting for input: auto-logout *设置命令行历史记录
[root@wen ~]# history -c #清除所有历史记录
[root@wen ~]# history #查看历史记录
history
[root@wen ~]# echo [root@wen ~]# echo [root@wen ~]# echo [root@wen ~]# echo [root@wen ~]# echo [root@wen ~]# history -d #删除指定行记录
[root@wen ~]# history
history
echo
echo
echo
echo
history -d
history
[root@wen ~]# ! #执行某行历史命令
history -d [root@wen ~]# export HISTSIZE= #控制历史记录记录数量(临时生效)#永久生效放在/etc/profile文件下,然后source以下/etc/profile
[root@wen ~]# history
history
echo
history -d
export HISTSIZE=
history
[root@wen ~]# cat ~/.bash_history #即使控制了在根目录下还有
[root@wen ~]# export HISTORYSIZE= #命令行命令对应文件的记录数 *隐藏版本信息
[root@wen ~]# cat /etc/issue
CentOS release 6.7 (Final)
Kernel \r on an \m [root@wen ~]# > /etc/issue
[root@wen ~]# cat /etc/issue.net
CentOS release 6.7 (Final)
Kernel \r on an \m
[root@wen ~]# >/etc/issue.net
[root@wen ~]# cat /etc/issue
[root@wen ~]#
9.28 linux系统基础优化的更多相关文章
- Linux实战教学笔记06:Linux系统基础优化
第六节 Linux系统基础优化 标签(空格分隔):Linux实战教学笔记-陈思齐 第1章 基础环境 第2章 使用网易163镜像做yum源 默认国外的yum源速度很慢,所以换成国内的. 第一步:先备份 ...
- Linu之linux系统基础优化和基本命令
Linux系统基础优化和基本命令 网络参数设定命令 ifconfig: 查询,设置网卡和ip等参数 ifup,ifdown: 脚本命令,更简单的方式 ip: 符合指令,直接修改上述功能 编辑网卡配置文 ...
- Linux 系统基础优化和常用命令
目录 Linux 系统基础优化和常用命令 软连接 tar解压命令 gzip命令 netstart命令 ps命令 kill命令 killall命令 SELinux功能 iptables防火墙 Linux ...
- 运维 07 Linux系统基础优化及常用命令
Linux系统基础优化及常用命令 Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令 ...
- Linux系统基础优化
一.关闭防火墙iptables: (1)关闭 /etc/init.d/iptables stop (2)检查 ...
- Linux系统基础优化及常用命令
Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和 ...
- 8,Linux系统基础优化及常用命令
Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和 ...
- 最简单易懂的linux系统基础优化
第10章 linux的系统优化 10.1 系统的版本,内核查看 10.1.1 系统版本的查看 [root@oldboy6666 ~]# cat /etc/redhat-release CentOS L ...
- linux系统基础优化及高级操作命令
Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和 ...
随机推荐
- jenkins自动化打包报错:gradle: 未找到命令
shell脚本如下: cd /home/wangju/gitProject/Automation echo "************************开始清理环境********** ...
- node+express解决前端跨域问题
var express = require('express') , app = express(); //解决跨域 app.all('*',function (req, res, next) { r ...
- (appium+python)UI自动化_09_unittest批量运行测试用例&生成测试报告
前言 上篇文章[(appium+python)UI自动化_08_unittest编写测试用例]讲到如何使用unittets编写测试用例,并执行测试文件.接下来讲解下unittest如何批量执行测试文件 ...
- python装饰器(基础中的重点)
一.简单的装饰器 1.为什么要使用装饰器呢? 装饰器的功能:在不修改原函数及其调用方式的情况下对原函数功能进行扩展 装饰器的本质:就是一个闭包函数 那么我们先来看一个简单的装饰器:实现计算每个函数的执 ...
- Jmeter-后置处理器(Json extractor)
后置处理器-json extractor 概念:顾名思义,提取json响应的数据中提取数据: 步骤:sampler-后置处理器-jsonextractor 1.提取单个参数 1.Variable na ...
- ios overflow:scroll不顺畅解决办法
是要在其样式里面添加这段代码就行 -webkit-overflow-scrolling: touch;
- 【题解】Intervals
题目大意 有\(n\)个区间(\(1 \leq n \leq 200\)),第\(i\)个区间覆盖\((a_{i}, b_{i})\)且有权值\(w_{i}\)(\(1 \leq a_{i} &l ...
- Blocks题解(区间dp)
Blocks题解 区间dp 阅读体验...https://zybuluo.com/Junlier/note/1289712 很好的一道区间dp的题目(别问我怎么想到的) dp状态 其实这个题最难的地方 ...
- docker pull理解误区
docker run 命令 如果local image中有对应 镜像+tag 不会从新拉取镜像 docker pull 会进行拉取 先进行镜像更改 [root@master01 ~]# docker ...
- 13、numpy——算术函数
NumPy 算术函数 1.NumPy 算术函数包含简单的加减乘除: add(),subtract(),multiply() 和 divide(). 需要注意的是数组必须具有相同的形状或符合数组广播规则 ...