一、设置时区linux
1web 2vim |
rm-f /etc/localtimessh cp/usr/share/zoneinfo/Asia/Shanghai/etc/localtimecurl |
二、配置内网IP (若是是外网IP,linux要修改远程端口)ide
三、配置本身的yum源url
1spa 2rest 3server 4 |
yum installwget rm-f /etc/yum.repos.d/CentOS-Base.repo wget -P /etc/yum.repos.d/ http://mirrors.163.com/.help/CentOS6-Base-163.repo wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo |
或者
1 2 |
curl http://mirrors.163.com/.help/CentOS6-Base-163.repo >/etc/yum.repos.d/comratings.repo curl http://mirrors.aliyun.com/repo/epel-6.repo > /etc/yum.repos.d/epel-6.repo |
如何须要最新版本的rpm包,请安装下面的仓库
1 |
rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm |
四、关闭SELinux
1 2 |
sed-i 's#SELINUX=enforcing#SELINUX=disabled#g'/etc/selinux/config setenforce 0 |
五、添加zabbix监控
六、配置防火墙
1 2 3 |
service iptables stop iptables -L service iptables save |
七、安装软件包
1 |
yum install-y vim openssh-clients ntpdate manlrzsz |
八、配置定时任务
1 |
echo"10 6 * * * root (/usr/sbin/ntpdate time.nist.gov && /sbin/hwclock -w) &> /dev/null">> /etc/crontab |
九、配置主机名
十、修改文件句柄数
1 2 3 4 5 6 |
#临时修改,马上生效 ulimit-n 655350 #永久修改 echo"* soft nofile 655360">> /etc/security/limits.conf echo"* hard nofile 655360">> /etc/security/limits.conf |
十一、能够禁用ipv6
1 2 3 4 |
cat>> /etc/modprobe.d/ipv6.conf < aliasnet-pf-10 off aliasipv6 off EOF |
十二、去除ssh远程DNS认证
1 2 3 |
sed-i 's/#UseDNS yes/UseDNS no/g'/etc/ssh/sshd_config sed-i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/g'/etc/ssh/sshd_config service sshd restart |
1三、配置LDAP客户端(可选)
1 |
yum installopenldap-clients nss-pam-ldapd -y |
1 2 3 4 5 6 7 8 9 |
authconfig --enablemkhomedir \ --disableldaptls \ --enablemd5 \ --enableldap \ --enableldapauth \ --ldapserver=ldap://211.x.x.27:8389 \ --ldapbasedn="dc=wzlinux,dc=com"\ --enableshadow \ --update |