• 关闭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 ~]#

最新文章

  1. JSON资料整理
  2. eclipse中怎么用cmd
  3. JSTL标签详解以及应用实例
  4. hdu 4897 Little Devil I
  5. 思科产品选型pdf
  6. Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.解决办法
  7. DevExpress 用户控件 分页(上)
  8. [置顶] Android EditText/TextView使用SpannableString显示复合文本
  9. C based
  10. SDL Guide 中文译版
  11. Git客户端(Windows系统)的使用(Putty)(转)
  12. Spring MVC 解决无法访问静态文件和"全局异常处理"
  13. z-index是什么样式?
  14. 死磕 java集合之TreeMap源码分析(四)-内含彩蛋
  15. LOJ #2205. 「HNOI2014」画框 解题报告
  16. debootstrap 配置
  17. mybatis的update使用选择
  18. 4-51单片机ESP8266学习-AT指令(测试TCP服务器--使用串口调试助手--不连接路由器)
  19. poj 1163 The Triangle 搜索 难度:0
  20. as3 string split方法一些注意

热门文章

  1. jmeter测试https请求
  2. Js DOM 修改 css Style
  3. 用BP人工神经网络识别手写数字
  4. HTML5移动应用——小心代码注入风险
  5. Invalid column name on sql server update after column create
  6. Tensorflow--Keras官方原文
  7. Neo4j elk Elasticsearch kibana kettle
  8. spring-第四篇之让bean获取所在的spring容器
  9. [CF453C] Little Poney and Summer Sun Celebration (思维)
  10. Codeforces 1093D(染色+组合数学)