Centos安装后的一些必要处理工作
2015-09-16 15:15
387 查看
1、永久关闭selinux,修改成permissive或者disabled(建议),修改完需重启
查看状态
或者在sysctl.conf中添加
4.(可选)登陆后显示信息,在""中输入需要在登陆后显示的信息
备份sshd_config文件
6.优化终端超时,终端超过600秒自动断开
8.Centos关闭Ctrl+Alt+Del快捷键防止重新启动
/article/10934168.html
[root@oracle ~]# 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=targeted1.1临时关闭selinux
查看状态
[root@centos etc]# getenforce Enforcing关闭(0为临时关闭,1为临时启动)
[root@centos etc]# setenforce 0 [root@centos etc]# getenforce Desabled2.配置network,修改如下
[root@oracle ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 EVICE=eth0 //网卡设备名称 HWADDR=98:BE:94:46:BC:B2 //网卡MAC TYPE=Ethernet //网络类型 UUID=a676465c-3608-44c2-9286-5e18c9cb9f64 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none IPADDR=192.168.1.105 //IP地址 NETMASK=255.255.255.0 //子网掩码 GATEWAY=192.168.1.1 //网关 DNS1=221.228.255.1 //DNS,也可以在resolv.conf配置3.禁止ping(可选,一般不需要禁止)(默认为0位启用ICMP协议,1为禁止),修改完无须重启
[root@oracle ipv4]# echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
或者在sysctl.conf中添加
[root@mysql ~]# echo "net.ipv4.icmp_echo_ignore_all=1" >> /etc/sysctl.conf [root@mysql ~]# tail -1 /etc/sysctl.conf net.ipv4.icmp_echo_ignore_all=1 [root@mysql ~]# sysctl -p
4.(可选)登陆后显示信息,在""中输入需要在登陆后显示的信息
[root@oracle ~]# echo "It is product environment,be careful..." > /etc/motd登陆后的信息
Using username "root". Last login: Tue Sep 15 14:24:31 2015 from 192.168.1.207 It is product environment,be careful...5.修改默认ssh设置,增加系统安全性
备份sshd_config文件
[root@mysql ssh]# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.20150915修改如下配置
//修改ssh远程连接的默认端口 #Port 22 修改成 Port 2510端口号自己指定 //ssh不允许root用户登录 #PermitRootLogin yes 修改成 PermitRootLogin no //解决DNS解析慢的问题 #UseDNS yes 修改成 UseDNS no //解决ssh慢的问题 #GSSAPIAuthentication no GSSAPIAuthentication yes 修改成 GSSAPIAuthentication no #GSSAPIAuthentication yes
6.优化终端超时,终端超过600秒自动断开
[root@mysql ~]# echo "export TMOUT=600" >> /etc/profile [root@mysql ~]# tail -1 /etc/profile export TMOUT=600 [root@mysql ~]# source /etc/profile7.控制历史命令记录数,历史命令文件路径:~/.bash_history
[root@mysql ~]# echo "export HISTSIZE=20" >> /etc/profile [root@mysql ~]# echo "export HISTFILESIZE=20" >> /etc/profile [root@mysql ~]# tail -2 /etc/profile export HISTSIZE=20 export HISTFILESIZE=20 [root@mysql ~]# source /etc/profile
8.Centos关闭Ctrl+Alt+Del快捷键防止重新启动
/article/10934168.html
相关文章推荐
- 有关Linux 50个趣味名人名言
- CentOS 6.6下的J2EE环境搭建(一)之JDK安装
- Linux鸟哥私房菜学习笔记--第10章
- linux mutext spinlock 性能分析
- linux c回调函数
- Linux RHCS 基础维护命令
- 基础教程:Linux 新手应该知道的 26 个命令
- RedHat 6.2 Linux修改yum源免费使用CentOS源
- CentOS yum源 部署
- CentOS下常用的 19 条命令
- linux系统查看外网IP
- Cobbler自动批量部署CentOS 6和CentOS 7
- 于linux已安装moodle
- 基于linux的bond技术
- 总结之:CentOS6.5下openssl加密解密及CA自签颁发证书详解
- Linux系统:开放源代码应用程序的编译与安装
- Ubuntu linux 环境基本使用
- linux信号掩码
- Linux中history输出格式的定制
- Linux系统中一些实用的快捷键