• 关闭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. 经常用到的meta标签的整理

    1.设置页面关键词<meta name="keywords" content="输入具体的关键词">2.设置页面的描述<meta name=& ...

  2. Jenkins 官网文档翻译汇总

    Jenkins 官网地址 Jenkins 官网文档地址 用户手册 安装 Jenkins 使用 Jenkins 使用凭证 Pipeline 流水线 开始使用 Pipeline 使用 Jenkinsfil ...

  3. WPF国际化方式1之资源文件

    先看效果吧,个人觉得由于MVVM模式的UI响应属性变化的特殊机制,资源文件和内存数据都是国际化不错的选择. 1.首先准备两个资源文件用来做中文和英文的转换使用,将程序中需要转换语言都弄成两个版本,分别 ...

  4. Go-内存To Be

    做一个快乐的互联网搬运工- 逃逸分析 逃逸分析的概念 在编译程序优化理论中,逃逸分析是一种确定指针动态范围的方法——分析在程序的哪些地方可以访问到指针. 它涉及到指针分析和形状分析. 当一个变量(或对 ...

  5. 关于static以及final关键字

    Static关键字: 可以用来修饰类中的属性.类中的方法.以及具体的某一个类. 1.用于修饰属性: 则表示该属性属于整个类,不论有多少个对象实例,所有的实例共同拥有一个static静态的成员变量.该变 ...

  6. vue配置域名访问

    vue配置域名访问其实很简单,新建一个vue的项目,不废话,直接上截图 红色框住的两行就是设置访问的域名以及端口,默认是host: localhost port: 8080 像这样修改之后,重启项目, ...

  7. 【五一qbxt】day6 OI中的stl

    from:why 很多很多part…… 1.pair: 相当于把两个变量放在一起: #include<utility> using namespace std; pair<TypeN ...

  8. HRESULT是什么类型

    HRESULT 是一种简单的数据类型,可以判断函数执行的结果.HRESULT 常被用作COM调用的返回值.充分利用HRESULT返回信息可以帮助提高我们的代码质量,提供程序的健壮性. HRESULT ...

  9. [BZOJ 3991][SDOI2015]寻宝游戏(dfs序)

    题面 小B最近正在玩一个寻宝游戏,这个游戏的地图中有N个村庄和N-1条道路,并且任何两个村庄之间有且仅有一条路径可达.游戏开始时,玩家可以任意选择一个村庄,瞬间转移到这个村庄,然后可以任意在地图的道路 ...

  10. Cannot modify header information - headers already sent by出错的原因

    <?php ob_start(); setcookie("username","送家",time()+3600); echo "the user ...