• 关闭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系统基础优化的更多相关文章

  1. Linux实战教学笔记06:Linux系统基础优化

    第六节 Linux系统基础优化 标签(空格分隔):Linux实战教学笔记-陈思齐 第1章 基础环境 第2章 使用网易163镜像做yum源 默认国外的yum源速度很慢,所以换成国内的. 第一步:先备份 ...

  2. Linu之linux系统基础优化和基本命令

    Linux系统基础优化和基本命令 网络参数设定命令 ifconfig: 查询,设置网卡和ip等参数 ifup,ifdown: 脚本命令,更简单的方式 ip: 符合指令,直接修改上述功能 编辑网卡配置文 ...

  3. Linux 系统基础优化和常用命令

    目录 Linux 系统基础优化和常用命令 软连接 tar解压命令 gzip命令 netstart命令 ps命令 kill命令 killall命令 SELinux功能 iptables防火墙 Linux ...

  4. 运维 07 Linux系统基础优化及常用命令

    Linux系统基础优化及常用命令   Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令 ...

  5. Linux系统基础优化

    一.关闭防火墙iptables:                (1)关闭                 /etc/init.d/iptables stop                (2)检查 ...

  6. Linux系统基础优化及常用命令

    Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和 ...

  7. 8,Linux系统基础优化及常用命令

    Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和 ...

  8. 最简单易懂的linux系统基础优化

    第10章 linux的系统优化 10.1 系统的版本,内核查看 10.1.1 系统版本的查看 [root@oldboy6666 ~]# cat /etc/redhat-release CentOS L ...

  9. linux系统基础优化及高级操作命令

    Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和 ...

随机推荐

  1. Node.js - 使用 Express 和 http-proxy 进行反向代理

    安装 Express 和 http-proxy npm install --save express http-proxy 反向代理代码 proxy.js var express = require( ...

  2. Keras 层layers总结

    https://blog.csdn.net/u010159842/article/details/78983841

  3. 批量执行SQL脚本

    新建文件夹all_sql,并将需要执行的sql脚本放入其中. 新建bat脚本,执行即可,ORACLE 也可改Mysql,按需:如下 ::echo off :: @echo off echo 开始执行数 ...

  4. HTML5移动应用——小心代码注入风险

    近日在加州举行的移动安全技术大会上,Syracuse大学的研究者的研究报告显示HTML5移动应用可能会给企业带来新的安全风险.开发者的错误可能导致HTML5应用自动执行攻击者通过Wifi蓝牙或短信发送 ...

  5. Unity3D热更新方案网摘总结

    参考:http://blog.csdn.net/guofeng526/article/details/52662994 http://blog.csdn.net/u010019717/article/ ...

  6. Codeforces - 1195E - OpenStreetMap - 单调队列

    https://codeforc.es/contest/1195/problem/E 一个能运行但是会T的版本,因为本质上还是\(O(nmab)\)的算法.每次\(O(ab)\)初始化矩阵中的可能有用 ...

  7. codeforces 448CPainting Fence

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/y990041769/article/details/37935237 题目:codeforces 4 ...

  8. JS的video获取时长,出现问题汇总

    <video id="my_video_1" controls="controls" style=" width: 700px; height: ...

  9. CSS中的关系选择器

    关系选择器是指根据与其他元素的关系选择元素的选择器,常见的符号有空格.>.~,还 有+等,这些都是非常常用的选择器. 后代选择器:选择所有合乎规则的后代元素.空格连接. 相邻后代选择器:仅仅选择 ...

  10. elasticsearch 基础 —— Inner hits

    Inner hits The parent-join and nested 功能允许返回具有不同范围匹配的文档.在父/子案例中,基于子文档中的匹配返回父文档,或者基于父文档中的匹配返回子文档.在嵌套的 ...