{"id":387,"date":"2019-06-22T12:37:10","date_gmt":"2019-06-22T04:37:10","guid":{"rendered":"https:\/\/www.aiqinqin.info\/?p=387"},"modified":"2024-07-03T11:07:18","modified_gmt":"2024-07-03T03:07:18","slug":"centos7%e5%88%9d%e5%a7%8b%e5%8c%96%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/www.aiqinqin.info\/?p=387","title":{"rendered":"centos7\u521d\u59cb\u5316\u811a\u672c"},"content":{"rendered":"<pre><code class=\"\">#!\/bin\/bash\n#update soft\nyum -y update\nyum install wget rsync bzip2 lsof telnet htop screen tree vim gcc make net-tools lrzsz psmisc hwloc gsmartcontrol chrony -y\n\n#\u65f6\u95f4\u8bbe\u7f6e \ntimedatectl set-local-rtc 1\ntimedatectl set-timezone Asia\/Shanghai\nsystemctl start chronyd.service\nsystemctl enable chronyd.service\n\n#\u8bbe\u7f6e\u6700\u5927\u6253\u5f00\u6587\u4ef6\u63cf\u8ff0\u7b26\u6570\necho \"ulimit -SHn 102400\" &gt;&gt; \/etc\/rc.local\ncat &gt;&gt; \/etc\/security\/limits.conf &lt;&lt;EOF\n*           soft   nofile       65535\n*           hard   nofile       65535\nEOF\n\n#\u7981\u7528selinux\nsed -i 's\/SELINUX=enforcing\/SELINUX=disabled\/' \/etc\/selinux\/config\nsetenforce 0\n\n#\u505c\u6b62\u4e0d\u5fc5\u8981\u7684\u670d\u52a1\nsystemctl disable --now rpcbind\nsystemctl disable --now rpcbind.socket\nsystemctl disable --now postfix.service\nsystemctl disable --now firewalld.service\nsystemctl disable --now firewalld\nsystemctl disable --now dnsmasq\nsystemctl disable --now NetworkManager\n\n#set ssh\nsed -i 's\/^GSSAPIAuthentication yes$\/GSSAPIAuthentication no\/' \/etc\/ssh\/sshd_config\nsed -i 's\/#UseDNS yes\/UseDNS no\/' \/etc\/ssh\/sshd_config\nsystemctl  restart sshd.service\n\n#\u5185\u6838\u53c2\u6570\u4f18\u5316\ncat &gt;&gt; \/etc\/sysctl.conf &lt;&lt;EOF\nvm.overcommit_memory = 1\nnet.ipv4.tcp_fin_timeout = 1\nnet.ipv4.tcp_keepalive_time = 1200\nnet.ipv4.tcp_mem = 94500000 915000000 927000000\nnet.ipv4.tcp_tw_reuse = 1\nnet.ipv4.tcp_tw_recycle = 1\nnet.ipv4.tcp_timestamps = 0\nnet.ipv4.tcp_synack_retries = 1\nnet.ipv4.tcp_syn_retries = 1\nnet.ipv4.tcp_abort_on_overflow = 0\nnet.core.rmem_max = 16777216\nnet.core.wmem_max = 16777216\nnet.core.netdev_max_backlog = 262144\nnet.ipv4.tcp_max_orphans = 3276800\nnet.ipv4.tcp_max_syn_backlog = 262144\nnet.core.wmem_default = 8388608\nnet.core.rmem_default = 8388608\nnet.ipv4.tcp_syncookies = 1\nEOF\n\/sbin\/sysctl -p\n\n# profile \u4fee\u6539\necho \"export HISTTIMEFORMAT=\\\"%F %T \\\"\" &gt;&gt; \/etc\/profile\necho \"\" &gt;&gt; \/etc\/profile\necho \"## \u81ea\u5b9a\u4e49\u522b\u540d\" &gt;&gt; \/etc\/profile\necho \"alias c=clear\" &gt;&gt; \/etc\/profile\necho \"alias vi=vim\" &gt;&gt; \/etc\/profile\necho \"alias dsh='du -hsx * | sort -rh | head -n 10'\" &gt;&gt; \/etc\/profile\nsed -i 's\/HISTSIZE=1000\/HISTSIZE=10000\/g' \/etc\/profile\nsource \/etc\/profile\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash #update soft yum -y update yum install wget [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,13],"tags":[],"class_list":["post-387","post","type-post","status-publish","format-standard","hentry","category-linux","category-shell-linux"],"_links":{"self":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=387"}],"version-history":[{"count":15,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/387\/revisions"}],"predecessor-version":[{"id":820,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/387\/revisions\/820"}],"wp:attachment":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}