• 关闭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. Python基础学习:operator模块

    operator——函数的标准操作 转自:https://blog.csdn.net/zhtysw/article/details/80510113 代码资源:Lib/operator.py oper ...

  2. leetcode 88. C++ 合并两个有序数组

    Leetcode 88. 合并两个有序数组 给定两个有序整数数组 nums1 和 nums2,将 nums2 合并到 nums1 中,使得 num1 成为一个有序数组. 说明: 初始化 nums1 和 ...

  3. win2016

    slmgr /ipk CB7KF-BWN84-R7R2Y-793K2-8XDDG slmgr /skms kms.03k.org slmgr /ato

  4. Vagrant 手册之 Provisioning - file 配置程序

    原文地址 Provisioner 命令:"file" 通过 file 配置程序可以上传宿主机的文件或目录到虚拟机中. 使用场景:将宿主机的 ~/.gitconfig 复制到虚拟机中 ...

  5. 第 3 章 前端基础之JavaScript

    一.JavaScript概述 1.javascripts的历史 1992年Nombas开发出C-minus-minus(C--)的嵌入式脚本语言(最初绑定在CEnvi软件中),后将其改名ScriptE ...

  6. 4期Web安全基础

    介绍了web安全的各种常见漏洞.视频卡顿,建议直接看网易出品的白帽子视频. 类似的教程还有,网易白帽子的教程:参考简书https://www.jianshu.com/p/1b372ca96b87 在看 ...

  7. Spring-Cloud-Alibaba-Nacos 目录

    Spring-Cloud-Alibaba-Nacos 目录 学习资料 Nacos 官网(https://nacos.io/zh-cn/docs/what-is-nacos.html) Nacos 程序 ...

  8. [BZOJ3626] [LNOI2014]LCA(树链剖分)

    [BZOJ3626] [LNOI2014]LCA(树链剖分) 题面 给出一棵N个点的树,要求支持Q次询问,每次询问一个点z与编号为区间[l,r]内的点分别求最近公共祖先得到的最近公共祖先深度和.N, ...

  9. Pandas的拼接操作

    pandas的拼接操作 pandas的拼接分为两种: 级联:pd.concat, pd.append 合并:pd.merge, pd.join import pandas as pd import n ...

  10. Warning: session_start(): open(/var/lib/php/session/)

    Warning: session_start(): open(/var/lib/php/session/) 今天放置一个新的站点www.96net.com.cn在里面,登陆后台出现这种错,之后再lin ...