{"id":763,"date":"2022-01-04T12:36:25","date_gmt":"2022-01-04T04:36:25","guid":{"rendered":"https:\/\/www.aiqinqin.info\/?p=763"},"modified":"2024-12-31T10:03:25","modified_gmt":"2024-12-31T02:03:25","slug":"ubuntu20-04-%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=763","title":{"rendered":"ubuntu20.04 \u521d\u59cb\u5316\u811a\u672c"},"content":{"rendered":"<pre><code class=\"\">#!\/bin\/bash\n\n#update soft\napt update &amp;&amp; apt upgrade\napt install wget tar curl rsync bzip2 lsof telnet htop screen tree vim gcc tree git 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 chrony\nsystemctl enable chrony\n\n\ncat &lt;&lt;EOF | sudo tee \/lib\/systemd\/system\/rc.local.service\n[Unit]\nDescription=\/etc\/rc.local Compatibility\nDocumentation=man:systemd-rc-local-generator(8)\nConditionFileIsExecutable=\/etc\/rc.local\nAfter=syslog.target network.target remote-fs.target nss-lookup.target\n\n[Service]\nType=forking\nExecStart=\/etc\/rc.local start\nTimeoutSec=0\nRemainAfterExit=no\nGuessMainPID=no\n\n[Install]\nWantedBy=multi-user.target\nAlias=rc-local.service\nEOF\n\nln -s \/lib\/systemd\/system\/rc.local.service \/etc\/systemd\/system\/rc.local.service\n\n\ncat &lt;&lt;EOF | sudo tee \/etc\/rc.local\n#!\/bin\/bash\n# \u5c06\u4f60\u9700\u8981\u6267\u884c\u7684\u547d\u4ee4\u5199\u5728\u8fd9\u91cc\uff0c\u7981\u6b62\u5199\u5165\u6b7b\u5faa\u73af\u547d\u4ee4\n\nexit 0\nEOF\n\nchmod 755 \/etc\/rc.local\n\n#\u8bbe\u7f6e\u6700\u5927\u6253\u5f00\u6587\u4ef6\u63cf\u8ff0\u7b26\u6570\ncat &gt;&gt; \/etc\/security\/limits.conf &lt;&lt;EOF\n*           soft   nofile       65535\n*           hard   nofile       65535\nEOF\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\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 apt update &amp;&amp; apt upgr [&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,20],"tags":[],"class_list":["post-763","post","type-post","status-publish","format-standard","hentry","category-linux","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/763","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=763"}],"version-history":[{"count":4,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions"}],"predecessor-version":[{"id":828,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions\/828"}],"wp:attachment":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}