博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux系统调优及安全设置
阅读量:6921 次
发布时间:2019-06-27

本文共 1646 字,大约阅读时间需要 5 分钟。

(1)关闭SELinux功能

它是美国安全局(NSA)对于强制访问控制的实现,我们需要把它关闭这也是生产环境的做法。

[root@linzhongniao ~]#sed -i 's#SELINUX=enforcing#SELINUX=diasbled#g' /etc/selinux/config[root@linzhongniao ~]# 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 disabled.# disabled - No SELinux policy is loaded.SELINUX=diasbled # SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,# mls - Multi Level Security protection.SELINUXTYPE=targeted[root@linzhongniao ~]# grep "SELINUX=diasbled" /etc/selinux/configSELINUX=disabled

查看selinux的状态

[root@linzhongniao ~]# getenforceEnforcing

修改完文件还是enforcing,只有重启才能生效生产中又不能重启服务器,我们可以用setenforce来设置

[root@linzhongniao ~]# setenforceusage:  setenforce [ Enforcing | Permissive | 1 | 0 ]

enforcing的状态是1 ,Permissive的状态是0 警告不影响,所以我们不用重启服务器,可以将selinux的状态设置为0

[root@linzhongniao ~]# setenforce 0[root@linzhongniao ~]# getenforcePermissive

(2)关闭防火墙

[root@linzhongniao ~]# /etc/init.d/iptables stopiptables: Setting chains to policy ACCEPT: filter  [  OK  ]iptables: Flushing firewall rules:   [  OK  ]iptables: Unloading modules: [  OK  ][root@linzhongniao ~]# /etc/init.d/iptables statusiptables: Firewall is not running.

永久关闭防火墙,禁止其开机自启动

[root@linzhongniao ~]# chkconfig iptables off

(3)linux中文显示设置

字符集的调整

[root@linzhongniao ~]# cat /etc/sysconfig/i18n LANG="zh_CN.UTF-8"SYSFONT="latarcyrheb-sun16"

(4)历史记录数及登录超时环境变量设置

用export TMOUT=10来设置超过10秒退出用户

linux系统调优及安全设置

也可以追加到/etc/profile里面让它永久生效,source /etc/profile

linux系统调优及安全设置

转载于:https://blog.51cto.com/10642812/2285527

你可能感兴趣的文章
windows 20008DHCP中继
查看>>
docker 容器网络篇
查看>>
DAY 19
查看>>
AD在windows2003中的更新
查看>>
Windows PowerShell 配置文件
查看>>
javap命令详解
查看>>
ELK之logstash长久运行
查看>>
vSphere Web Client连接vCenter提示flash崩溃
查看>>
kft-activiti-demo
查看>>
变更管理7R
查看>>
2016年上半年网络工程师培训考试感想
查看>>
LESS CSS 框架简介
查看>>
Kobject浅析
查看>>
Shell常用命令小结
查看>>
我的友情链接
查看>>
jboss
查看>>
repmgr实现pg流复制失效自动切换
查看>>
Ubuntu使用ufw进行防火墙设置
查看>>
Innodb 关于blob、text字段的存储以及性能
查看>>
基于LVS-NAT的WEB服务的负载均衡实现
查看>>