<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>爱周末 &#187; Linux系统初始化</title>
	<atom:link href="http://zhoumo123.cn/tag/linux%e7%b3%bb%e7%bb%9f%e5%88%9d%e5%a7%8b%e5%8c%96/feed" rel="self" type="application/rss+xml" />
	<link>http://zhoumo123.cn</link>
	<description>知识分享，共同进步。zhoumo123.cn</description>
	<lastBuildDate>Thu, 07 Nov 2019 05:53:49 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.1</generator>
	<item>
		<title>Linux系统初始化脚本</title>
		<link>http://zhoumo123.cn/linux/329.html</link>
		<comments>http://zhoumo123.cn/linux/329.html#comments</comments>
		<pubDate>Wed, 10 Sep 2014 12:14:48 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Linux系统初始化]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=329</guid>
		<description><![CDATA[Linux系统初始化脚本如下： &#160; 原文地址：http://azhuang.blog.51cto.com/9176790/1550438]]></description>
				<content:encoded><![CDATA[<p>Linux系统初始化脚本如下：</p>
<pre class="brush: php; title: ; notranslate">

#!/bin/bash
#gcc install
yum install -y gcc
#vim install
yum install -y vim
#Development Tools
yum groupinstall -y &quot;Development Libraries&quot; &quot;Development Tools&quot;
# close iptables
yum -y install iptables
/etc/init.d/iptables stop
/sbin/iptables -F
service iptables save
/etc/init.d/iptables stop
chkconfig iptables off

# disable ipv6
echo &quot;alias net-pf-10 off&quot; &gt;&gt; /etc/modprobe.conf
echo &quot;alias ipv6 off&quot; &gt;&gt; /etc/modprobe.conf
/sbin/chkconfig --level 35 ip6tables off
echo &quot;ipv6 is disabled!&quot;

#yum install
yum install -y lrzsz
yum -y install xfsdump
yum -y install wget
yum -y install redhat-lsb

#disable selinux
sed -i &quot;s/SELINUX=enforcing/SELINUX=disabled/&quot; /etc/selinux/config
echo &quot;selinux is disabled,you must reboot!&quot;


#modify timezone
echo 'y'| cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

#sync time
yum install -y ntp
/usr/sbin/ntpdate ntp.api.bz &gt; /dev/null 2&gt;&amp;1
echo &quot;/usr/sbin/ntpdate ntp.api.bz &gt; /dev/null 2&gt;&amp;1&quot; &gt;&gt; /etc/rc.local
echo &quot;modprobe ip_conntrack &gt; /dev/null 2&gt;&amp;1&quot; &gt;&gt; /etc/rc.local
#tunoff services
for i in `ls /etc/rc3.d/S*`
do
CURSRV=`echo $i | cut -c 15-`
echo $CURSRV
case $CURSRV in
crond | irqbalance | microcode_ctl | network | random | sendmail | sshd | syslog | local )
echo &quot;Base services,skip!&quot;
;;
*)
echo &quot;change $CURSRV to off&quot;
chkconfig --level 235 $CURSRV off
service $CURSRV stop
;;
esac
done

echo &quot;ulimit -SHn 65535&quot; &gt;&gt; /etc/profile
echo &quot;* soft nofile 65536&quot; &gt;&gt; /etc/security/limits.conf
echo &quot;* hard nofile 65536&quot; &gt;&gt; /etc/security/limits.conf
echo ''&gt;/etc/sysctl.conf
cat &gt;&gt;/etc/sysctl.conf&lt;&lt;eof
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_tw_buckets = 60000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.ip_local_port_range = 1024 65000
fs.file-max = 102400
net.ipv4.ip_conntrack_max = 1048576
net.ipv4.netfilter.ip_conntrack_max = 131072
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 216000
eof
modprobe ip_conntrack
sysctl -p
#修改ssh默认dns解析
sed -i '/AddressFamily/ a\UseDNS no' /etc/ssh/sshd_config

#添加默认lib库文件
touch /etc/ld.so.conf.d/default.conf
echo &quot;/usr/lib&quot; &gt;&gt; /etc/ld.so.conf.d/default.conf
echo &quot;/usr/lib64&quot; &gt;&gt; /etc/ld.so.conf.d/default.conf
echo &quot;/usr/local/lib&quot; &gt;&gt; /etc/ld.so.conf.d/default.conf
echo &quot;/usr/local/lib64&quot; &gt;&gt; /etc/ld.so.conf.d/default.conf
ldconfig
echo &quot;初始化系统没有完成！&quot;

</pre>
<p>&nbsp;</p>
<p>原文地址：http://azhuang.blog.51cto.com/9176790/1550438</p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/linux/329.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
