标签:mat 自己 forward style 理由 table release x86_64 查看系统
[root@oldboyedu-40 oldboy]# cat /etc/redhat-release CentOS release 6.9 (Final)
[root@oldboyedu-40 oldboy]# uname -r 2.6.32-696.el6.x86_64 内核版本位2.6.32 [root@oldboyedu-40 oldboy]# uname -m x86_64
[root@oldboyedu-40 oldboy]# useradd oldboy 添加一个叫oldboy的用户 [root@oldboyedu-40 oldboy]# passwd oldboy 为oldboy用户添加密码 Changing password for user oldboy. New password: BAD PASSWORD: it is too simplistic/systematic 提示密码太简单了 BAD PASSWORD: is too simple 可以不理会 Retype new password: 再次输入新密码 passwd: all authentication tokens updated successfully.(成功) 密码设置成功
[root@oldboyedu-40 /]# su - oldboy 切换用户 [oldboy@oldboyedu-40 ~]$ whoami 显示当前在哪个用户下 oldboy
第一个里程碑 -永久关闭selinux 修改selinux的配置文件 #enforcing selinux默认状态 selinux已经开启 正在运行 #permissive selinux临时关闭 显示警告 #disabled selinux彻底关闭 [root@oldboyedu-40 ~]# cat /etc/selinux/config 看一下文件里面的内容 # This file controls the state of SELinux on the s # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enfor # permissive - SELinux prints warnings instead # disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@oldboyedu-40 ~]# sed ‘s#SELINUX=enforcing#SELINUX=disabled#g‘ /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@oldboyedu-40 ~]# sed -i ‘s#SELINUX=enforcing#SELINUX=disabled#g‘ /etc/selinux/config 确定修改替换配置信息 [root@oldboyedu-40 ~]# grep "SELINUX=" /etc/selinux/config 查询是否更改成功 # SELINUX= can take one of these three values: SELINUX=disabled ###selinux配置文件生效--需要重启服务器 #不要给自己找任何理由重启服务器 第二个里程碑--临时关闭selinux 1. ###查看selinux是否正在运行 [root@oldboyedu-40 ~]# getenforce Enforcing selinux正在运行 2.临时关闭selinux [root@oldboyedu-40 ~]# setenforce usage: setenforce [ Enforcing | Permissive | 1 | 0 ] 1是运行 0是关闭 [root@oldboyedu-40 ~]# setenforce 0 [root@oldboyedu-40 ~]# getenforce Permissive 小结: 如何关闭selinux 永久关闭selinux /etc/selinux/config 临时关闭 selinux setenforce
###防火墙--------相当于我们大楼的门卫 保安
###工作中如何使用 何时开启关闭 防火墙
[root@oldboyedu-40 ~]# /etc/init.d/iptables status Table: filter Chain INPUT (policy ACCEPT) num target prot opt source destination 1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 5 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) num target prot opt source destination 1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) num target prot opt source destination
[root@oldboyedu-40 ~]# /etc/init.d/iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] [root@oldboyedu-40 ~]# /etc/init.d/iptables stop [root@oldboyedu-40 ~]# /etc/init.d/iptables status iptables: Firewall is not running.
#让iptables防火墙 在开机的时候不启动 [root@oldboyedu-40 ~]# chkconfig |grep ipt iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@oldboyedu-40 ~]# chkconfig iptables off [root@oldboyedu-40 ~]# chkconfig |grep ipt iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@oldboyedu-40 ~]# /etc/init.d/iptables status 检查iptables状态 iptables: Firewall is not running.
什么是字符集?
常用的字符集 UTF-8
如何查看字符集 变量中
查询当前系统使用的字符集
[root@oldboyedu-40 ~]# echo $LANG en_US.UTF-8
LANG 环境变量
[root@oldboyedu-40 ~]# export LANG=zh_CN.UTF-8 修改字符集 [root@oldboyedu-40 ~]# echo $LANG 查看字符集 zh_CN.UTF-8
修改后 setup 会中文显示
[root@oldboyedu-40 ~]# cat /etc/sysconfig/i18n LANG="en_US.UTF-8" SYSFONT="latarcyrheb-sun16"
将LANG="en_US.UTF-8"修改成LANG="zh_CN.UTF-8"就是修改了字符集
source /etc/sysconfig/i18n
系统的字符集 echo $LANG 和远程连接软件 (xshell)的字符集不同
解决方法:
修改远程连接软件(xshell)的字符集
修改linux系统的字符集 1.临时生效:export LANG=要修改的字集
2.永久:修改/etc/sysconfig/i18n文件中的LANG="en_US.UTF-8"
修改后让其生效 source /etc/sysconfig/i18n
本博文中所使用的系统版本为: CentOS release 6.9 (Final) 内核版本为: 2.6.32-696.10.1.el6.x86_64 linux正在持续学习中
标签:mat 自己 forward style 理由 table release x86_64 查看系统
原文地址:http://www.cnblogs.com/dzc-/p/7736380.html