{"id":3181,"date":"2026-04-24T21:13:49","date_gmt":"2026-04-24T13:13:49","guid":{"rendered":"https:\/\/linuxjk.cn\/?p=3181"},"modified":"2026-04-24T21:13:51","modified_gmt":"2026-04-24T13:13:51","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%89%e5%85%a8%e5%8a%a0%e5%9b%ba%e7%ad%96%e7%95%a5-md","status":"publish","type":"post","link":"https:\/\/linuxjk.cn\/?p=3181","title":{"rendered":"\u670d\u52a1\u5668\u5b89\u5168\u52a0\u56fa\u7b56\u7565.md"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#Windows\" >Windows<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E9%85%8D%E7%BD%AE%E6%97%A5%E5%BF%97\" >\u914d\u7f6e\u65e5\u5fd7<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#1_%E5%88%9B%E5%BB%BA%E6%97%A5%E5%BF%97%E5%AD%98%E5%82%A8%E7%9B%AE%E5%BD%95\" >1. \u521b\u5efa\u65e5\u5fd7\u5b58\u50a8\u76ee\u5f55<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#2%E9%85%8D%E7%BD%AE%E4%BA%8B%E4%BB%B6%E6%97%A5%E5%BF%97%E5%B1%9E%E6%80%A7\" >2.\u914d\u7f6e\u4e8b\u4ef6\u65e5\u5fd7\u5c5e\u6027<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E9%87%8D%E5%90%AF%E5%90%8E%E7%BB%93%E6%9E%9C\" >\u91cd\u542f\u540e\u7ed3\u679c:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E5%AF%86%E7%A0%81%E5%A4%8D%E6%9D%82%E5%BA%A6%E6%9C%89%E6%95%88%E6%9C%9F\" >\u5bc6\u7801\u590d\u6742\u5ea6+\u6709\u6548\u671f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E5%AF%86%E7%A0%81%E5%A4%8D%E6%9D%82%E5%BA%A6_%E6%9C%89%E6%95%88%E6%9C%9F%EF%BC%88%E5%9F%9F%E6%8E%A7%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%89\" >\u5bc6\u7801\u590d\u6742\u5ea6 + \u6709\u6548\u671f\uff08\u57df\u63a7\u670d\u52a1\u5668\uff09<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#22_%E9%85%8D%E7%BD%AE%E5%90%84%E9%A1%B9%E7%AD%96%E7%95%A5\" >2.2 \u914d\u7f6e\u5404\u9879\u7b56\u7565<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E9%94%81%E5%AE%9A%E7%AD%96%E7%95%A5%E3%80%81%E8%BF%9E%E6%8E%A5%E8%B6%85%E6%97%B6\" >\u9501\u5b9a\u7b56\u7565\u3001\u8fde\u63a5\u8d85\u65f6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E8%BF%9C%E7%A8%8B%E7%AE%A1%E7%90%86%E6%8C%87%E5%AE%9A%E5%AE%89%E5%85%A8%E5%B1%82\" >\u8fdc\u7a0b\u7ba1\u7406\u6307\u5b9a\u5b89\u5168\u5c42<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E5%AF%B9%E7%94%A8%E6%88%B7%E5%88%86%E9%85%8D%E8%B4%A6%E6%88%B7%E5%92%8C%E6%9D%83%E9%99%90\" >\u5bf9\u7528\u6237\u5206\u914d\u8d26\u6237\u548c\u6743\u9650<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E5%AE%89%E5%85%A8%E5%AE%A1%E8%AE%A1%E5%8A%9F%E8%83%BD\" >\u5b89\u5168\u5ba1\u8ba1\u529f\u80fd<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E5%8F%8A%E6%97%B6%E6%B8%85%E7%90%86%E5%AD%98%E6%94%BE%E5%9C%A8%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84%E7%94%A8%E6%88%B7%E9%89%B4%E5%88%AB%E4%BF%A1%E6%81%AF\" >\u53ca\u65f6\u6e05\u7406\u5b58\u653e\u5728\u7cfb\u7edf\u4e2d\u7684\u7528\u6237\u9274\u522b\u4fe1\u606f<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#Linux\" >Linux<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AF%86%E7%A0%81%E5%A4%8D%E6%9D%82%E5%BA%A6%E6%9C%89%E6%95%88%E6%9C%9F\" >\u670d\u52a1\u5668\u5bc6\u7801\u590d\u6742\u5ea6+\u6709\u6548\u671f<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E6%89%8B%E5%8A%A8%E9%85%8D%E7%BD%AE%E6%AD%A5%E9%AA%A4%EF%BC%9A\" >\u624b\u52a8\u914d\u7f6e\u6b65\u9aa4\uff1a<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E\" >\u53c2\u6570\u8bf4\u660e<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#pwquality_%E5%8F%82%E6%95%B0\" >pwquality \u53c2\u6570<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#logindefs_%E5%8F%82%E6%95%B0\" >login.defs \u53c2\u6570<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E9%AA%8C%E8%AF%81%E9%85%8D%E7%BD%AE\" >\u9a8c\u8bc1\u914d\u7f6e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E6%B5%8B%E8%AF%95%E5%AF%86%E7%A0%81%E5%A4%8D%E6%9D%82%E5%BA%A6\" >\u6d4b\u8bd5\u5bc6\u7801\u590d\u6742\u5ea6<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC\" >\u81ea\u52a8\u5316\u811a\u672c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E9%85%8D%E7%BD%AE%E5%90%8E%E9%AA%8C%E8%AF%81%E6%B8%85%E5%8D%95\" >\u914d\u7f6e\u540e\u9a8c\u8bc1\u6e05\u5355<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#Linux%E6%97%A5%E5%BF%97%E5%AE%A1%E8%AE%A1\" >Linux\u65e5\u5fd7\u5ba1\u8ba1<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E6%89%8B%E5%8A%A8%E9%85%8D%E7%BD%AE\" >\u624b\u52a8\u914d\u7f6e<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E9%85%8D%E7%BD%AE%E5%89%8D%E6%A3%80%E6%9F%A5\" >\u914d\u7f6e\u524d\u68c0\u67e5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E9%AA%8C%E8%AF%81%E9%85%8D%E7%BD%AE-2\" >\u9a8c\u8bc1\u914d\u7f6e<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC%EF%BC%9A\" >\u81ea\u52a8\u5316\u811a\u672c\uff1a<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/linuxjk.cn\/?p=3181\/#%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81\" >\u6d4b\u8bd5\u9a8c\u8bc1<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Windows\"><\/span>Windows<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE%E6%97%A5%E5%BF%97\"><\/span>\u914d\u7f6e\u65e5\u5fd7<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7\u3001\u5b89\u5168\u65e5\u5fd7\u548c\u7cfb\u7edf\u4e0a\u4f20\u65e5\u5fd7\u5ba1\u8ba1\uff0c\u65e5\u5fd7\u7559\u5b58\u65f6\u95f4\u9700\u6ee1\u8db36\u4e2a\u6708\u3002<\/p>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6848\uff1a\u5efa\u8bae\u66f4\u6539\u65e5\u5fd7\u5b58\u50a8\u8def\u5f84\uff0c\u81ea\u5b9a\u4e49\u5b58\u591f\u6b64\u7c7b\u578b\u65e5\u5fd76\u4e2a\u6708\u7684\u5b58\u50a8\u7a7a\u95f4\uff0c\u52fe\u9009\u201c\u65e5\u5fd7\u6ee1\u65f6\u5c06\u5176\u5b58\u6863\uff0c\u4e0d\u8981\u8986\u76d6\u201d\uff1b\u5e76\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u53d1\u9001\u81f3\u65e5\u5fd7\u5ba1\u8ba1\uff0c\u7ba1\u7406\u5458\u5b9a\u671f\u67e5\u770b\u65e5\u5fd7\u5ba1\u8ba1\u8bb0\u5f55\uff0c\u786e\u4fdd\u65e5\u5fd7\u53ef\u6ee1\u8db3\u5b58\u653e6\u4e2a\u6708\u4ee5\u4e0a\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_%E5%88%9B%E5%BB%BA%E6%97%A5%E5%BF%97%E5%AD%98%E5%82%A8%E7%9B%AE%E5%BD%95\"><\/span>1. \u521b\u5efa\u65e5\u5fd7\u5b58\u50a8\u76ee\u5f55<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>\uff08\u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7Application\u3001\u5b89\u5168\u65e5\u5fd7Security\u3001\u7cfb\u7edf\u65e5\u5fd7System\uff09<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20260109145725100.png\" alt=\"image-20260109145725054\"\/><\/figure>\n\n\n\n<p>\u521b\u5efa\u6307\u5b9a\u7684 3 \u4e2a\u76ee\u5f55<\/p>\n\n\n\n<p>\u590d\u5236\u9ed8\u8ba4\u4e8b\u4ef6\u65e5\u5fd7\u76ee\u5f55 <code>%SystemRoot%\\System32\\winevt\\Logs<\/code> \u7684 ACL<\/p>\n\n\n\n<p>\u628a\u76ee\u5f55\u6240\u6709\u8005\u6539\u6210 <code>SYSTEM<\/code>\uff0c\u5e76\u786e\u4fdd <code>NT SERVICE\\EventLog<\/code> \u6709\u5b8c\u5168\u63a7\u5236\u6743\u9650<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c PowerShell<br>\u200b<br>$sourceFolder = \"$env:SystemRoot\\System32\\winevt\\Logs\"<br>$targetFolders = @(<br> &nbsp; &nbsp;\"E:\\WindowsLogs\\Application\",<br> &nbsp; &nbsp;\"E:\\WindowsLogs\\Security\",<br> &nbsp; &nbsp;\"E:\\WindowsLogs\\System\"<br>)<br>\u200b<br># \u8bfb\u53d6\u9ed8\u8ba4\u4e8b\u4ef6\u65e5\u5fd7\u76ee\u5f55 ACL<br>$sourceAcl = Get-Acl -Path $sourceFolder -Audit -AllCentralAccessPolicies<br>\u200b<br>foreach ($folder in $targetFolders) {<br> &nbsp; &nbsp;# 1. \u521b\u5efa\u76ee\u5f55<br> &nbsp; &nbsp;if (-not (Test-Path -LiteralPath $folder)) {<br> &nbsp; &nbsp; &nbsp; &nbsp;New-Item -Path $folder -ItemType Directory -Force | Out-Null<br> &nbsp; &nbsp; &nbsp; &nbsp;Write-Host \"\u5df2\u521b\u5efa\u76ee\u5f55: $folder\"<br> &nbsp; &nbsp;} else {<br> &nbsp; &nbsp; &nbsp; &nbsp;Write-Host \"\u76ee\u5f55\u5df2\u5b58\u5728: $folder\"<br> &nbsp; &nbsp;}<br>\u200b<br> &nbsp; &nbsp;# 2. \u590d\u5236\u9ed8\u8ba4 ACL<br> &nbsp; &nbsp;Set-Acl -Path $folder -AclObject $sourceAcl -ClearCentralAccessPolicy<br>\u200b<br> &nbsp; &nbsp;# 3. \u8bbe\u7f6e\u6240\u6709\u8005\u4e3a SYSTEM<br> &nbsp; &nbsp;$acl = Get-Acl -Path $folder -Audit -AllCentralAccessPolicies<br> &nbsp; &nbsp;$acl.SetOwner([System.Security.Principal.NTAccount]::new(\"SYSTEM\"))<br>\u200b<br> &nbsp; &nbsp;# 4. \u786e\u4fdd NT SERVICE\\EventLog \u5177\u6709\u5b8c\u5168\u63a7\u5236\u6743\u9650<br> &nbsp; &nbsp;$eventLogRule = New-Object System.Security.AccessControl.FileSystemAccessRule(<br> &nbsp; &nbsp; &nbsp; &nbsp;\"NT SERVICE\\EventLog\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"FullControl\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"ContainerInherit,ObjectInherit\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"None\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"Allow\"<br> &nbsp; &nbsp;)<br> &nbsp; &nbsp;$acl.SetAccessRule($eventLogRule)<br>\u200b<br> &nbsp; &nbsp;# 5. \u5199\u56de ACL<br> &nbsp; &nbsp;Set-Acl -Path $folder -AclObject $acl -ClearCentralAccessPolicy<br>\u200b<br> &nbsp; &nbsp;Write-Host \"\u5df2\u5b8c\u6210 ACL \u914d\u7f6e: $folder\"<br>}<br>\u200b<br>Write-Host \"`n\u5168\u90e8\u5b8c\u6210\u3002\u4e0b\u4e00\u6b65\u53bb\u4e8b\u4ef6\u67e5\u770b\u5668\u91cc\u4fee\u6539\u65e5\u5fd7\u8def\u5f84\"<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2%E9%85%8D%E7%BD%AE%E4%BA%8B%E4%BB%B6%E6%97%A5%E5%BF%97%E5%B1%9E%E6%80%A7\"><\/span>2.<strong>\u914d\u7f6e\u4e8b\u4ef6\u65e5\u5fd7\u5c5e\u6027<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>\u6253\u5f00\u4e8b\u4ef6\u67e5\u770b\u5668<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u65b9\u6cd51\uff1a<br>Win + R \u2192 eventvwr.msc \u2192 \u56de\u8f66<br>\u200b<br>\u65b9\u6cd52\uff1a<br>\u670d\u52a1\u5668\u7ba1\u7406\u5668 \u2192 \u5de5\u5177 \u2192 \u4e8b\u4ef6\u67e5\u770b\u5668<br>\u200b<br>\u65b9\u6cd53\uff1a<br>\u5f00\u59cb\u83dc\u5355\u641c\u7d22\"\u4e8b\u4ef6\u67e5\u770b\u5668\"<\/pre>\n\n\n\n<p><strong>\u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1. \u4e8b\u4ef6\u67e5\u770b\u5668<br> &nbsp; \u2514\u2500 Windows \u65e5\u5fd7<br> &nbsp; &nbsp;  \u2514\u2500 \u5e94\u7528\u7a0b\u5e8f\uff08\u53f3\u952e\uff09 \u2192 \u5c5e\u6027<br>2. \u5728\"\u5e94\u7528\u7a0b\u5e8f \u5c5e\u6027\"\u7a97\u53e3\u4e2d\u914d\u7f6e\uff1a<br>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br>\u2502 \u5e94\u7528\u7a0b\u5e8f \u5c5e\u6027 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502<br>\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u5e38\u89c4\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502<br>\u2502 &nbsp; \u65e5\u5fd7\u8def\u5f84\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 &nbsp; E:\\WindowsLogs\\Application\\Application.evtx  \u2190 \u4fee\u6539\u8fd9\u91cc<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 &nbsp; \u6700\u5927\u65e5\u5fd7\u5927\u5c0f(KB)\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 &nbsp; [ &nbsp;5000000  ] KB  (\u7ea6 5 GB) &nbsp; &nbsp; &nbsp; &nbsp;  \u2190 \u4fee\u6539\u8fd9\u91cc<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 &nbsp; \u5f53\u8fbe\u5230\u6700\u5927\u65e5\u5fd7\u5927\u5c0f\u65f6\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 &nbsp; \u25cb \u6309\u9700\u8981\u8986\u76d6\u4e8b\u4ef6\uff08\u6700\u65e7\u7684\u4e8b\u4ef6\u4f18\u5148\uff09 &nbsp; &nbsp;  \u2502<br>\u2502 &nbsp; \u25cb \u5b58\u6863\u65e5\u5fd7\uff0c\u4e0d\u8986\u76d6\u4e8b\u4ef6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2190 \u9009\u62e9\u8fd9\u4e2a \u2705<br>\u2502 &nbsp; \u25cb \u4e0d\u8986\u76d6\u4e8b\u4ef6\uff08\u624b\u52a8\u6e05\u9664\u65e5\u5fd7\uff09 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 &nbsp; [\u6e05\u9664\u65e5\u5fd7] &nbsp; [\u786e\u5b9a] &nbsp; [\u53d6\u6d88] &nbsp; [\u5e94\u7528] &nbsp; &nbsp; &nbsp; \u2502<br>\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br>3. \u70b9\u51fb\"\u786e\u5b9a\"<\/pre>\n\n\n\n<p><strong>\u914d\u7f6e\u5b89\u5168\u65e5\u5fd7<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1. \u4e8b\u4ef6\u67e5\u770b\u5668<br> &nbsp; \u2514\u2500 Windows \u65e5\u5fd7<br> &nbsp; &nbsp;  \u2514\u2500 \u5b89\u5168\uff08\u53f3\u952e\uff09 \u2192 \u5c5e\u6027<br>2. \u914d\u7f6e\u53c2\u6570\uff1a<br>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br>\u2502 \u5b89\u5168 \u5c5e\u6027 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502<br>\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u65e5\u5fd7\u8def\u5f84\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 E:\\WindowsLogs\\Security\\Security.evtx  \u2502<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u6700\u5927\u65e5\u5fd7\u5927\u5c0f(KB)\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 [ &nbsp;10000000  ] KB  (\u7ea6 10 GB) &nbsp; &nbsp; &nbsp; &nbsp;  \u2502 \u2190 \u5b89\u5168\u65e5\u5fd7\u901a\u5e38\u6700\u5927<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u5f53\u8fbe\u5230\u6700\u5927\u65e5\u5fd7\u5927\u5c0f\u65f6\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u2611 \u5b58\u6863\u65e5\u5fd7\uff0c\u4e0d\u8986\u76d6\u4e8b\u4ef6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502 \u2705<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 [\u786e\u5b9a] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502<br>\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br>3. \u70b9\u51fb\"\u786e\u5b9a\"<\/pre>\n\n\n\n<p><strong>\u914d\u7f6e\u7cfb\u7edf\u65e5\u5fd7<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1. \u4e8b\u4ef6\u67e5\u770b\u5668<br> &nbsp; \u2514\u2500 Windows \u65e5\u5fd7<br> &nbsp; &nbsp;  \u2514\u2500 \u7cfb\u7edf\uff08\u53f3\u952e\uff09 \u2192 \u5c5e\u6027<br>2. \u914d\u7f6e\u53c2\u6570\uff1a<br>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br>\u2502 \u7cfb\u7edf \u5c5e\u6027 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502<br>\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u65e5\u5fd7\u8def\u5f84\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 E:\\WindowsLogs\\System\\System.evtx &nbsp; &nbsp;  \u2502<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u6700\u5927\u65e5\u5fd7\u5927\u5c0f(KB)\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 [ &nbsp;3000000  ] KB  (\u7ea6 3 GB) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u5f53\u8fbe\u5230\u6700\u5927\u65e5\u5fd7\u5927\u5c0f\u65f6\uff1a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 \u2611 \u5b58\u6863\u65e5\u5fd7\uff0c\u4e0d\u8986\u76d6\u4e8b\u4ef6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502 \u2705<br>\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2502<br>\u2502 [\u786e\u5b9a] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \u2502<br>\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br>3. \u70b9\u51fb\"\u786e\u5b9a\"<\/pre>\n\n\n\n<p><strong>\u91cd\u542f\u4e8b\u4ef6\u65e5\u5fd7\u670d\u52a1<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#\u670d\u52a1\u7ba1\u7406\u5668\u91cd\u542f<br>services.msc \u2192 Windows Event Log \u2192 \u91cd\u65b0\u542f\u52a8<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%87%8D%E5%90%AF%E5%90%8E%E7%BB%93%E6%9E%9C\"><\/span><strong>\u91cd\u542f\u540e\u7ed3\u679c<\/strong>:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AF%86%E7%A0%81%E5%A4%8D%E6%9D%82%E5%BA%A6%E6%9C%89%E6%95%88%E6%9C%9F\"><\/span>\u5bc6\u7801\u590d\u6742\u5ea6+\u6709\u6548\u671f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">\u6b65\u9aa4 1\uff1a\u6253\u5f00\u672c\u5730\u5b89\u5168\u7b56\u7565<br>\u65b9\u5f0f\u4e00\uff1a\u8fd0\u884c\u547d\u4ee4<br>Win + R \u2192 \u8f93\u5165\uff1asecpol.msc \u2192 \u56de\u8f66<br>\u65b9\u5f0f\u4e8c\uff1a\u670d\u52a1\u5668\u7ba1\u7406\u5668<br>\u670d\u52a1\u5668\u7ba1\u7406\u5668 \u2192 \u5de5\u5177 \u2192 \u672c\u5730\u5b89\u5168\u7b56\u7565<br>\u200b<br>\u6b65\u9aa4 2\uff1a\u914d\u7f6e\u5bc6\u7801\u7b56\u7565<br>2.1 \u5c55\u5f00\u7b56\u7565\u8def\u5f84<br>\u672c\u5730\u5b89\u5168\u7b56\u7565<br>\u2514\u2500\u2500 \u8d26\u6237\u7b56\u7565<br> &nbsp;  \u2514\u2500\u2500 \u5bc6\u7801\u7b56\u7565<\/pre>\n\n\n\n<p>2.2 <strong>\u914d\u7f6e\u5404\u9879\u7b56\u7565<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7b56\u7565\u9879<\/th><th>\u8bbe\u7f6e\u503c<\/th><th>\u8bf4\u660e<\/th><\/tr><\/thead><tbody><tr><td><strong>\u5bc6\u7801\u5fc5\u987b\u7b26\u5408\u590d\u6742\u6027\u8981\u6c42<\/strong><\/td><td><code>\u5df2\u542f\u7528<\/code><\/td><td>\u2705 \u542f\u7528\u590d\u6742\u5ea6\u68c0\u67e5<\/td><\/tr><tr><td><strong>\u5bc6\u7801\u957f\u5ea6\u6700\u5c0f\u503c<\/strong><\/td><td><code>8<\/code><\/td><td>\u2705 \u6700\u5c118\u4e2a\u5b57\u7b26<\/td><\/tr><tr><td><strong>\u5bc6\u7801\u6700\u957f\u4f7f\u7528\u671f\u9650<\/strong><\/td><td><code>90<\/code> \u5929<\/td><td>\u2705 90\u5929\u540e\u8fc7\u671f<\/td><\/tr><tr><td><strong>\u7528\u53ef\u8fd8\u539f\u7684\u52a0\u5bc6\u6765\u5b58\u50a8\u5bc6\u7801<\/strong><\/td><td><code>\u5df2\u7981\u7528<\/code><\/td><td>\u26a0\ufe0f \u7981\u7528<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">2.3 \u8be6\u7ec6\u914d\u7f6e\u6b65\u9aa4<br>\u2460 \u5bc6\u7801\u5fc5\u987b\u7b26\u5408\u590d\u6742\u6027\u8981\u6c42<br>1. \u53cc\u51fb \"\u5bc6\u7801\u5fc5\u987b\u7b26\u5408\u590d\u6742\u6027\u8981\u6c42\"<br>2. \u9009\u62e9 \"\u5df2\u542f\u7528\"<br>3. \u70b9\u51fb \"\u5e94\u7528\" \u2192 \"\u786e\u5b9a\"<br>\u2461 \u5bc6\u7801\u957f\u5ea6\u6700\u5c0f\u503c<br>1. \u53cc\u51fb \"\u5bc6\u7801\u957f\u5ea6\u6700\u5c0f\u503c\"<br>2. \u8bbe\u7f6e\u4e3a\uff1a8<br>3. \u70b9\u51fb \"\u5e94\u7528\" \u2192 \"\u786e\u5b9a\"<br>\u2462 \u5bc6\u7801\u6700\u957f\u4f7f\u7528\u671f\u9650<br>1. \u53cc\u51fb \"\u5bc6\u7801\u6700\u957f\u4f7f\u7528\u671f\u9650\"<br>2. \u8bbe\u7f6e\u4e3a\uff1a90 \u5929<br>3. \u70b9\u51fb \"\u5e94\u7528\" \u2192 \"\u786e\u5b9a\"<br>\u6b65\u9aa4 3\uff1a\u5e94\u7528\u7b56\u7565<br>\u7acb\u5373\u5f3a\u5236\u66f4\u65b0<br>Win + R \u2192 \u8f93\u5165\uff1acmd \u2192 \u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c<br>\u200b<br>\u6267\u884c\u547d\u4ee4\uff1a<br>gpupdate \/force<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AF%86%E7%A0%81%E5%A4%8D%E6%9D%82%E5%BA%A6_%E6%9C%89%E6%95%88%E6%9C%9F%EF%BC%88%E5%9F%9F%E6%8E%A7%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%89\"><\/span>\u5bc6\u7801\u590d\u6742\u5ea6 + \u6709\u6548\u671f\uff08\u57df\u63a7\u670d\u52a1\u5668\uff09<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">\u6b65\u9aa4 1\uff1a\u6253\u5f00\u7ec4\u7b56\u7565\u7ba1\u7406<br>Win + R \u2192 \u8f93\u5165\uff1agpmc.msc \u2192 \u56de\u8f66<br><br>\u6b65\u9aa4 2\uff1a\u914d\u7f6e\u57df\u5bc6\u7801\u7b56\u7565<br>\u65b9\u5f0f\u4e00\uff08\u63a8\u8350\uff09\uff1a<br>\u76f4\u63a5\u7f16\u8f91 \u201cDefault Domain Policy\u201d<br><br>\u65b9\u5f0f\u4e8c\uff1a<br>\u65b0\u5efa\u4e00\u4e2a\u57df\u7ea7 GPO\uff08\u94fe\u63a5\u5230\u57df\u6839\uff09\uff0c<br>\u5e76\u786e\u4fdd\u5176\u4f18\u5148\u7ea7\u9ad8\u4e8e Default Domain Policy<\/pre>\n\n\n\n<p>2.1 \u914d\u7f6e\u8def\u5f84<\/p>\n\n\n\n<p>\u8ba1\u7b97\u673a\u914d\u7f6e \u2514\u2500\u2500 Windows \u8bbe\u7f6e \u2514\u2500\u2500 \u5b89\u5168\u8bbe\u7f6e \u2514\u2500\u2500 \u8d26\u6237\u7b56\u7565 \u2514\u2500\u2500 \u5bc6\u7801\u7b56\u7565<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"22_%E9%85%8D%E7%BD%AE%E5%90%84%E9%A1%B9%E7%AD%96%E7%95%A5\"><\/span>2.2 \u914d\u7f6e\u5404\u9879\u7b56\u7565<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7b56\u7565\u9879<\/th><th>\u8bbe\u7f6e\u503c<\/th><th>\u8bf4\u660e<\/th><\/tr><\/thead><tbody><tr><td><strong>\u5bc6\u7801\u5fc5\u987b\u7b26\u5408\u590d\u6742\u6027\u8981\u6c42<\/strong><\/td><td><code>\u5df2\u542f\u7528<\/code><\/td><td>\u2705 \u542f\u7528\u590d\u6742\u5ea6\u68c0\u67e5<\/td><\/tr><tr><td><strong>\u5bc6\u7801\u957f\u5ea6\u6700\u5c0f\u503c<\/strong><\/td><td><code>8<\/code><\/td><td>\u2705 \u6700\u5c11 8 \u4e2a\u5b57\u7b26<\/td><\/tr><tr><td><strong>\u5bc6\u7801\u6700\u957f\u4f7f\u7528\u671f\u9650<\/strong><\/td><td><code>90<\/code> \u5929<\/td><td>\u2705 90 \u5929\u540e\u8fc7\u671f<\/td><\/tr><tr><td><strong>\u7528\u53ef\u8fd8\u539f\u7684\u52a0\u5bc6\u6765\u5b58\u50a8\u5bc6\u7801<\/strong><\/td><td><code>\u5df2\u7981\u7528<\/code><\/td><td>\u26a0\ufe0f \u7981\u7528<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">2.3 \u8be6\u7ec6\u914d\u7f6e\u6b65\u9aa4<br><br>\u2460 \u5bc6\u7801\u5fc5\u987b\u7b26\u5408\u590d\u6742\u6027\u8981\u6c42<br>1. \u53cc\u51fb \"\u5bc6\u7801\u5fc5\u987b\u7b26\u5408\u590d\u6742\u6027\u8981\u6c42\"<br>2. \u9009\u62e9 \"\u5df2\u542f\u7528\"<br>3. \u70b9\u51fb \"\u5e94\u7528\" \u2192 \"\u786e\u5b9a\"<br><br>\u2461 \u5bc6\u7801\u957f\u5ea6\u6700\u5c0f\u503c<br>1. \u53cc\u51fb \"\u5bc6\u7801\u957f\u5ea6\u6700\u5c0f\u503c\"<br>2. \u8bbe\u7f6e\u4e3a\uff1a8<br>3. \u70b9\u51fb \"\u5e94\u7528\" \u2192 \"\u786e\u5b9a\"<br><br>\u2462 \u5bc6\u7801\u6700\u957f\u4f7f\u7528\u671f\u9650<br>1. \u53cc\u51fb \"\u5bc6\u7801\u6700\u957f\u4f7f\u7528\u671f\u9650\"<br>2. \u8bbe\u7f6e\u4e3a\uff1a90 \u5929<br>3. \u70b9\u51fb \"\u5e94\u7528\" \u2192 \"\u786e\u5b9a\"<br><br>\u2463 \u7528\u53ef\u8fd8\u539f\u7684\u52a0\u5bc6\u6765\u5b58\u50a8\u5bc6\u7801<br>1. \u53cc\u51fb \"\u7528\u53ef\u8fd8\u539f\u7684\u52a0\u5bc6\u6765\u5b58\u50a8\u5bc6\u7801\"<br>2. \u9009\u62e9 \"\u5df2\u7981\u7528\"<br>3. \u70b9\u51fb \"\u5e94\u7528\" \u2192 \"\u786e\u5b9a\"<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>\u5e94\u7528\u7b56\u7565<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">gpupdate \/force<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>\u9a8c\u8bc1\u7ed3\u679c<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">PowerShell\uff08\u7ba1\u7406\u5458\uff09\u6267\u884c\uff1a<br>Get-ADDefaultDomainPasswordPolicy<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%94%81%E5%AE%9A%E7%AD%96%E7%95%A5%E3%80%81%E8%BF%9E%E6%8E%A5%E8%B6%85%E6%97%B6\"><\/span>\u9501\u5b9a\u7b56\u7565\u3001\u8fde\u63a5\u8d85\u65f6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5e94\u5177\u6709\u767b\u5f55\u5931\u8d25\u5904\u7406\u529f\u80fd\uff0c\u914d\u7f6e\u5e76\u542f\u7528\u7ed3\u675f\u4f1a\u8bdd\u3001\u9650\u5236\u975e\u6cd5\u767b\u5f55\u6b21\u6570\u548c\u5f53\u767b\u5f55\u8fde\u63a5\u8d85\u65f6\u81ea\u52a8\u9000\u51fa\u7b49\u76f8\u5173\u63aa\u65bd\uff1b\u5c31\u5728\u5bc6\u7801\u7b56\u7565\u7684\u4e0b\u9762\u5c31\u6709\u9501\u5b9a\u7b56\u7565<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%BF%9C%E7%A8%8B%E7%AE%A1%E7%90%86%E6%8C%87%E5%AE%9A%E5%AE%89%E5%85%A8%E5%B1%82\"><\/span>\u8fdc\u7a0b\u7ba1\u7406\u6307\u5b9a\u5b89\u5168\u5c42<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53\u8fdb\u884c\u8fdc\u7a0b\u7ba1\u7406\u65f6\uff0c\u5e94\u91c7\u53d6\u5fc5\u8981\u63aa\u65bd\uff0c\u9632\u6b62\u9274\u522b\u4fe1\u606f\u5728\u7f51\u7edc\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u88ab\u7a83\u542c\uff1b<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AF%B9%E7%94%A8%E6%88%B7%E5%88%86%E9%85%8D%E8%B4%A6%E6%88%B7%E5%92%8C%E6%9D%83%E9%99%90\"><\/span>\u5bf9\u7528\u6237\u5206\u914d\u8d26\u6237\u548c\u6743\u9650<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5e94\u5bf9\u767b\u5f55\u7684\u7528\u6237\u5206\u914d\u8d26\u6237\u548c\u6743\u9650\uff1b\uff08\u521b\u5efa\u7cfb\u7edf\u7ba1\u7406\u5458\u3001\u5b89\u5168\u7ba1\u7406\u5458\u3001\u5ba1\u8ba1\u7ba1\u7406\u5458\uff09 \u53ea\u9700\u8981\u505a\u4e24\u4ef6\u4e8b\uff1a\u91cd\u547d\u540dadmin\uff0c\u4e09\u6743\u5206\u7acb \u8fdb\u5165\u201c\u8ba1\u7b97\u673a\u7ba1\u7406\u2014\u672c\u5730\u7528\u6237\u548c\u7ec4\u2014\u7528\u6237<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%89%E5%85%A8%E5%AE%A1%E8%AE%A1%E5%8A%9F%E8%83%BD\"><\/span>\u5b89\u5168\u5ba1\u8ba1\u529f\u80fd<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5e94\u542f\u7528\u5b89\u5168\u5ba1\u8ba1\u529f\u80fd\uff0c\u5ba1\u8ba1\u8986\u76d6\u5230\u6bcf\u4e2a\u7528\u6237\uff0c\u5bf9\u91cd\u8981\u7684\u7528\u6237\u884c\u4e3a\u548c\u91cd\u8981\u5b89\u5168\u4e8b\u4ef6\u8fdb\u884c\u5ba1\u8ba1\uff1b\u7ba1\u7406\u5de5\u5177-\u8d26\u6237\u7b56\u7565-\u672c\u5730\u7b56\u7565-\u5ba1\u6838\u7b56\u7565\u3010\u914d\u7f6e\u5bc6\u7801\u7684\u4e0b\u9762\u3011<\/p>\n\n\n\n<p>\u5ba1\u8ba1\u8bb0\u5f55\u5e94\u5305\u62ec\u4e8b\u4ef6\u7684\u65e5\u671f\u548c\u65f6\u95f4\u3001\u7528\u6237\u3001\u4e8b\u4ef6\u7c7b\u578b\u3001\u4e8b\u4ef6\u662f\u5426\u6210\u529f\u53ca\u5176\u4ed6\u4e0e\u5ba1\u8ba1\u76f8\u5173\u7684\u4fe1\u606f\uff1b\u53f3\u952e\u201c\u8ba1\u7b97\u673a\u201d-\u7ba1\u7406-\u4e8b\u4ef6\u67e5\u770b\u5668-windows\u65e5\u5fd7-\u5e94\u7528\u7a0b\u5e8f\/\u5b89\u5168\/\u7cfb\u7edf<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%8A%E6%97%B6%E6%B8%85%E7%90%86%E5%AD%98%E6%94%BE%E5%9C%A8%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84%E7%94%A8%E6%88%B7%E9%89%B4%E5%88%AB%E4%BF%A1%E6%81%AF\"><\/span>\u53ca\u65f6\u6e05\u7406\u5b58\u653e\u5728\u7cfb\u7edf\u4e2d\u7684\u7528\u6237\u9274\u522b\u4fe1\u606f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u53ca\u65f6\u6e05\u7406\u5b58\u653e\u5728\u7cfb\u7edf\u4e2d\u7684\u7528\u6237\u9274\u522b\u4fe1\u606f\uff0c\u9632\u6b62\u4fe1\u606f\u5916\u6cc4\uff0c\u88ab\u9ed1\u5ba2\u5229\u7528 \u7ba1\u7406\u5de5\u5177\u2014\u672c\u5730\u5b89\u5168\u7b56\u7565\u2014\u672c\u5730\u7b56\u7565\u2014\u5b89\u5168\u9009\u9879\uff1a\u5173\u673a\uff1a\u6e05\u9664\u865a\u62df\u5185\u5b58\u9875\u9762\u6587\u4ef6 \u3010\u5176\u5b9e\u5c31\u5728\u914d\u7f6e\u5bc6\u7801\u7b56\u7565\u7684\u4e0b\u9762\uff0c\u6240\u4ee5\u914d\u7f6e\u5b8c\u4e86\u8bdd\u4e0d\u8981\u5173\u95ed\uff0c\u5f88\u591a\u914d\u7f6e\u5176\u5b9e\u90fd\u662f\u5728\u4e00\u4e2a\u9875\u9762\u3011<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Linux\"><\/span>Linux<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AF%86%E7%A0%81%E5%A4%8D%E6%9D%82%E5%BA%A6%E6%9C%89%E6%95%88%E6%9C%9F\"><\/span>\u670d\u52a1\u5668\u5bc6\u7801\u590d\u6742\u5ea6+\u6709\u6548\u671f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6848\uff1aLinux\u670d\u52a1\u5668\u5728\/etc\/pam.d\/system-auth\u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6e\u5bc6\u7801\u6700\u5c0f\u957f\u5ea6\u4e3a8\u4f4d\uff0c\u5f15\u7528pwquality.so\u6a21\u5757\uff0c\u914d\u7f6e\u5bc6\u7801\u5fc5\u987b\u7531\u5927\u5c0f\u5199\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7279\u6b8a\u5b57\u7b26\u4e2d\u4e09\u79cd\u6216\u4e09\u79cd\u4ee5\u4e0a, \u5bc6\u7801\u6709\u6548\u671f\u4e3a90\u5929\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%89%8B%E5%8A%A8%E9%85%8D%E7%BD%AE%E6%AD%A5%E9%AA%A4%EF%BC%9A\"><\/span>\u624b\u52a8\u914d\u7f6e\u6b65\u9aa4\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">\u4e00\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305<br># \u68c0\u67e5\u662f\u5426\u5df2\u5b89\u88c5 pwquality<br>rpm -qa | grep libpwquality<br><br># \u5982\u679c\u672a\u5b89\u88c5\uff0c\u6267\u884c\u5b89\u88c5<br>dnf install -y libpwquality<br><br>\u4e8c\u3001\u68c0\u67e5 authselect \u72b6\u6001<br># \u67e5\u770b\u5f53\u524d authselect \u914d\u7f6e<br>authselect current<br><br># \u68c0\u67e5\u5f53\u524d\u914d\u7f6e\u662f\u5426\u5b8c\u6574<br>authselect check<br><br>1. \u5982\u679c authselect check \u8fd4\u56de\u6b63\u5e38\uff0c\u53ef\u7ee7\u7eed\u914d\u7f6e\u3002<br>2. \u672a\u542f\u7528 authselect\uff0c\u53ea\u8981 PAM \u6587\u4ef6\u4e2d\u5df2\u7ecf\u52a0\u8f7d\u4e86 pam_pwquality.so\uff0c\u5c31\u53ef\u4ee5\u7ee7\u7eed\u6309\u7167\u624b\u5de5\u65b9\u5f0f\u914d\u7f6e\u3002<br>   <br>#\u4e09\u3001\u786e\u8ba4 pam_pwquality \u6a21\u5757\u5df2\u5728 PAM \u4e2d\u542f\u7528<br>grep pam_pwquality.so \/etc\/pam.d\/system-auth \/etc\/pam.d\/password-auth<br>#\u5982\u679c\u80fd\u770b\u5230\u7c7b\u4f3c\u4e0b\u9762\u7684\u884c\uff0c\u8bf4\u660e\u5bc6\u7801\u8d28\u91cf\u6a21\u5757\u5df2\u7ecf\u542f\u7528\uff0c\u53ef\u4ee5\u7ee7\u7eed\u6309\u7167\u624b\u5de5\u65b9\u5f0f\u914d\u7f6e<br>#password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=<br>#\u914d\u7f6eroot\u7528\u6237\u4e5f\u9075\u5b88\u5bc6\u7801\u590d\u6742\u5ea6<br>sed -i 's\/pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=\/pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type= enforce_for_root\/' \/etc\/pam.d\/system-auth<br>sed -i 's\/pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=\/pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type= enforce_for_root\/' \/etc\/pam.d\/password-auth<br><br>#\u672a\u627e\u5230 pam_pwquality.so\uff0c\u8bf4\u660e\u6a21\u5757\u672a\u542f\u7528\uff0c\u9700\u8981\u624b\u5de5\u8865\u5145 PAM \u914d\u7f6e\u3002<br>#\u5206\u522b\u7f16\u8f91\u4e24\u4e2a\u6587\u4ef6\uff0c\u5728 password \u6bb5\u3001pam_unix.so \u4e4b\u524d\u52a0\u5165\uff1a<br>#vim \/etc\/pam.d\/system-auth<br>#vim \/etc\/pam.d\/password-auth<br>#password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type= enforce_for_root<br><br><br><br><br>\u56db\u3001\u914d\u7f6e\u5bc6\u7801\u590d\u6742\u5ea6\u8981\u6c42<br># \u5907\u4efd\u539f\u6587\u4ef6<br>cp \/etc\/security\/pwquality.conf \/etc\/security\/pwquality.conf.bak.$(date +%F)<br><br># \u7f16\u8f91\u6587\u4ef6<br>vim \/etc\/security\/pwquality.conf<br># \u5bc6\u7801\u6700\u5c0f\u957f\u5ea6 8 \u4f4d<br>minlen = 8<br># \u81f3\u5c11\u5305\u542b 3 \u79cd\u5b57\u7b26\u7c7b\u578b\uff08\u5927\u5199\u3001\u5c0f\u5199\u3001\u6570\u5b57\u3001\u7279\u6b8a\u5b57\u7b26\uff09<br>minclass = 3<br># \u65b0\u5bc6\u7801\u4e2d\u6700\u591a\u6709 3 \u4e2a\u5b57\u7b26\u4e0e\u65e7\u5bc6\u7801\u76f8\u540c<br>difok = 3<br># \u7981\u6b62\u4f7f\u7528\u7528\u6237\u540d<br>usercheck = 1<br># \u542f\u7528\u5b57\u5178\u68c0\u67e5<br>dictcheck = 1<br><br><br>#1. \u8fd9\u91cc\u4f7f\u7528 minclass = 3\uff0c\u8868\u793a\u56db\u7c7b\u5b57\u7b26\u4e2d\u81f3\u5c11\u6ee1\u8db3\u4e09\u7c7b\u5373\u53ef\u3002<br>#2. \u4e0d\u518d\u540c\u65f6\u5199 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1\uff0c<br>   \u5426\u5219\u4f1a\u53d8\u6210\u201c\u6bcf\u7c7b\u90fd\u81f3\u5c11 1 \u4e2a\u201d\uff0c\u4e0e\u201c\u81f3\u5c11 3 \u7c7b\u201d\u76ee\u6807\u51b2\u7a81\u3002<br>   <br>\u4e94\u3001\u914d\u7f6e\u5bc6\u7801\u6709\u6548\u671f 90 \u5929<br># \u5907\u4efd<br>cp \/etc\/login.defs \/etc\/login.defs.bak.$(date +%F)<br><br># \u7f16\u8f91<br>vim \/etc\/login.defs<br>PASS_MAX_DAYS   90<br>PASS_MIN_DAYS   0<br>PASS_WARN_AGE   7<br>PASS_MIN_LEN    8<br><br><br>#\u8bf4\u660e:<br>#1. \/etc\/login.defs \u4e3b\u8981\u5f71\u54cd\u65b0\u521b\u5efa\u7528\u6237\u7684\u9ed8\u8ba4\u5bc6\u7801\u65f6\u6548\u7b56\u7565\u3002<br>#2. \u5df2\u5b58\u5728\u7528\u6237\u9700\u8981\u4f7f\u7528 chage \u5355\u72ec\u8c03\u6574\u3002<br><br>\u516d\u3001\u5bf9\u5df2\u5b58\u5728\u7684\u7528\u6237\u4fee\u6539\u5bc6\u7801\u7b56\u7565<br># \u67e5\u770b\u5f53\u524d root \u7528\u6237\u5bc6\u7801\u7b56\u7565<br>chage -l root<br><br># \u4e3a root \u8bbe\u7f6e\u5bc6\u7801\u6709\u6548\u671f 90 \u5929<br>chage -M 90 -m 0 -W 7 root<br><br># \u6279\u91cf\u4fee\u6539\u6240\u6709\u666e\u901a\u7528\u6237\uff08UID &gt;= 1000\uff0c\u6392\u9664 nobody\uff09<br>for user in $(awk -F: '$3&gt;=1000 &amp;&amp; $3!=65534 {print $1}' \/etc\/passwd); do<br>    chage -M 90 -m 0 -W 7 \"$user\"<br>    echo \"\u5df2\u8bbe\u7f6e\u7528\u6237 $user \u7684\u5bc6\u7801\u7b56\u7565\"<br>done<br><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E\"><\/span>\u53c2\u6570\u8bf4\u660e<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<h5 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"pwquality_%E5%8F%82%E6%95%B0\"><\/span>pwquality \u53c2\u6570<span class=\"ez-toc-section-end\"><\/span><\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u53c2\u6570<\/th><th>\u8bf4\u660e<\/th><th>\u63a8\u8350\u503c<\/th><\/tr><\/thead><tbody><tr><td><code>minlen<\/code><\/td><td>\u5bc6\u7801\u6700\u5c0f\u957f\u5ea6<\/td><td><code>8<\/code><\/td><\/tr><tr><td><code>minclass<\/code><\/td><td>\u81f3\u5c11\u6ee1\u8db3\u7684\u5b57\u7b26\u7c7b\u578b\u6570<\/td><td><code>3<\/code><\/td><\/tr><tr><td><code>difok<\/code><\/td><td>\u4e0e\u65e7\u5bc6\u7801\u81f3\u5c11\u4e0d\u540c\u7684\u5b57\u7b26\u6570<\/td><td><code>3<\/code><\/td><\/tr><tr><td><code>usercheck<\/code><\/td><td>\u7981\u6b62\u4f7f\u7528\u7528\u6237\u540d\u76f8\u5173\u5185\u5bb9<\/td><td><code>1<\/code><\/td><\/tr><tr><td><code>dictcheck<\/code><\/td><td>\u542f\u7528\u5b57\u5178\u68c0\u67e5<\/td><td><code>1<\/code><\/td><\/tr><tr><td><code>enforce_for_root<\/code><\/td><td>\u5bf9 root \u751f\u6548<\/td><td>\u542f\u7528<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"logindefs_%E5%8F%82%E6%95%B0\"><\/span>login.defs \u53c2\u6570<span class=\"ez-toc-section-end\"><\/span><\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u53c2\u6570<\/th><th>\u8bf4\u660e<\/th><th>\u63a8\u8350\u503c<\/th><\/tr><\/thead><tbody><tr><td><code>PASS_MAX_DAYS<\/code><\/td><td>\u5bc6\u7801\u6700\u5927\u6709\u6548\u671f<\/td><td><code>90<\/code><\/td><\/tr><tr><td><code>PASS_MIN_DAYS<\/code><\/td><td>\u4e24\u6b21\u4fee\u6539\u6700\u5c0f\u95f4\u9694<\/td><td><code>0<\/code><\/td><\/tr><tr><td><code>PASS_WARN_AGE<\/code><\/td><td>\u8fc7\u671f\u524d\u544a\u8b66\u5929\u6570<\/td><td><code>7<\/code><\/td><\/tr><tr><td><code>PASS_MIN_LEN<\/code><\/td><td>\u6700\u5c0f\u957f\u5ea6\u9ed8\u8ba4\u503c<\/td><td><code>8<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%AA%8C%E8%AF%81%E9%85%8D%E7%BD%AE\"><\/span>\u9a8c\u8bc1\u914d\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">1. \u68c0\u67e5 PAM \u6a21\u5757\u662f\u5426\u5df2\u52a0\u8f7d\uff0c\u5e76\u786e\u8ba4\u662f\u5426\u542f\u7528\u4e86 root \u5f3a\u5236\u68c0\u67e5<br>grep pam_pwquality.so \/etc\/pam.d\/system-auth \/etc\/pam.d\/password-auth<br>2. \u68c0\u67e5 pwquality \u914d\u7f6e<br>grep -v '^#' \/etc\/security\/pwquality.conf | grep -v '^$'<br>3. \u68c0\u67e5\u5bc6\u7801\u6709\u6548\u671f\u9ed8\u8ba4\u914d\u7f6e<br>grep PASS_ \/etc\/login.defs | grep -v '^#'<br>4. \u68c0\u67e5 root \u7528\u6237\u5bc6\u7801\u7b56\u7565<br>chage -l root<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%B5%8B%E8%AF%95%E5%AF%86%E7%A0%81%E5%A4%8D%E6%9D%82%E5%BA%A6\"><\/span>\u6d4b\u8bd5\u5bc6\u7801\u590d\u6742\u5ea6<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u521b\u5efa\u6d4b\u8bd5\u7528\u6237<br>useradd testuser<br><br># \u8bbe\u7f6e\u5bc6\u7801<br>passwd testuser<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC\"><\/span>\u81ea\u52a8\u5316\u811a\u672c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><code>password_policy_anolis89.sh<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#!\/bin\/bash<br>#########################################################################<br># Script Name: password_policy_anolis89.sh<br># Description: Anolis 8.9 \u5bc6\u7801\u590d\u6742\u5ea6\u548c\u6709\u6548\u671f\u914d\u7f6e\u811a\u672c<br># Author: OpenAI<br># Version: 1.0<br># Notes:<br>#   1. \u9002\u7528\u4e8e Anolis 8.9 \u672c\u5730\u8d26\u6237\u573a\u666f<br>#   2. \u4e0d\u4f9d\u8d56 authselect\uff1b\u5373\u4f7f\u672a\u542f\u7528 authselect \u4e5f\u53ef\u6267\u884c<br>#   3. \u82e5\u670d\u52a1\u5668\u5df2\u63a5\u5165 AD\/IPA\/SSSD\/realm\uff0c\u8bf7\u5148\u4eba\u5de5\u786e\u8ba4\u540e\u518d\u6267\u884c<br>#########################################################################<br><br>set -euo pipefail<br><br># \u989c\u8272\u5b9a\u4e49<br>RED='\\033[0;31m'<br>GREEN='\\033[0;32m'<br>YELLOW='\\033[1;33m'<br>BLUE='\\033[0;34m'<br>NC='\\033[0m'<br><br># \u53c2\u6570\u5b9a\u4e49<br>MINLEN=8<br>MINCLASS=3<br>DIFOK=3<br>PASS_MAX_DAYS=90<br>PASS_MIN_DAYS=0<br>PASS_WARN_AGE=7<br>PASS_MIN_LEN=8<br>RETRY=3<br><br>BACKUP_DIR=\"\/root\/password_policy_backup_$(date +%Y%m%d_%H%M%S)\"<br>PWQUALITY_CONF=\"\/etc\/security\/pwquality.conf\"<br>LOGIN_DEFS=\"\/etc\/login.defs\"<br><br>log_info() {<br>    echo -e \"${GREEN}[INFO]${NC} $1\"<br>}<br><br>log_warn() {<br>    echo -e \"${YELLOW}[WARN]${NC} $1\"<br>}<br><br>log_error() {<br>    echo -e \"${RED}[ERROR]${NC} $1\"<br>}<br><br>log_step() {<br>    echo -e \"${BLUE}[STEP]${NC} $1\"<br>}<br><br>check_root() {<br>    if [ \"$(id -u)\" -ne 0 ]; then<br>        log_error \"\u6b64\u811a\u672c\u5fc5\u987b\u4ee5 root \u7528\u6237\u8fd0\u884c\u3002\"<br>        exit 1<br>    fi<br>}<br><br>check_os() {<br>    log_step \"\u68c0\u67e5\u7cfb\u7edf\u7248\u672c\"<br>    if [ ! -f \/etc\/os-release ]; then<br>        log_error \"\u65e0\u6cd5\u8bc6\u522b\u7cfb\u7edf\u7248\u672c\uff1a\/etc\/os-release \u4e0d\u5b58\u5728\"<br>        exit 1<br>    fi<br><br>    . \/etc\/os-release<br><br>    if [[ \"${VERSION_ID:-}\" != 8* ]]; then<br>        log_error \"\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u4e3a ${VERSION_ID:-unknown}\uff0c\u6b64\u811a\u672c\u4ec5\u9002\u7528\u4e8e Anolis\/RHEL 8 \u7cfb\u3002\"<br>        exit 1<br>    fi<br><br>    log_info \"\u5f53\u524d\u7cfb\u7edf\uff1a${PRETTY_NAME:-unknown}\"<br>}<br><br>check_managed_auth() {<br>    log_step \"\u68c0\u67e5\u662f\u5426\u63a5\u5165\u96c6\u4e2d\u8ba4\u8bc1\uff08realm\/IPA\uff09\"<br><br>    if command -v realm &gt;\/dev\/null 2&gt;&amp;1; then<br>        if realm list 2&gt;\/dev\/null | grep -q '^realm-name:'; then<br>            log_error \"\u68c0\u6d4b\u5230\u7cfb\u7edf\u5df2\u63a5\u5165 realm\/AD\/IPA\uff0c\u8bf7\u5148\u4eba\u5de5\u786e\u8ba4\u8ba4\u8bc1\u65b9\u6848\u540e\u518d\u4fee\u6539 PAM\u3002\"<br>            exit 1<br>        fi<br>    fi<br><br>    if [ -f \/etc\/ipa\/default.conf ]; then<br>        log_error \"\u68c0\u6d4b\u5230 IPA \u5ba2\u6237\u7aef\u914d\u7f6e\uff0c\u8bf7\u5148\u4eba\u5de5\u786e\u8ba4\u8ba4\u8bc1\u65b9\u6848\u540e\u518d\u4fee\u6539 PAM\u3002\"<br>        exit 1<br>    fi<br><br>    log_info \"\u672a\u68c0\u6d4b\u5230\u96c6\u4e2d\u8ba4\u8bc1\u63a5\u5165\uff0c\u7ee7\u7eed\u6267\u884c\u3002\"<br>}<br><br>install_package() {<br>    log_step \"\u68c0\u67e5\u5e76\u5b89\u88c5 libpwquality\"<br>    if rpm -q libpwquality &gt;\/dev\/null 2&gt;&amp;1; then<br>        log_info \"libpwquality \u5df2\u5b89\u88c5\"<br>    else<br>        dnf install -y libpwquality<br>        log_info \"libpwquality \u5b89\u88c5\u5b8c\u6210\"<br>    fi<br>}<br><br>check_authselect() {<br>    log_step \"\u68c0\u67e5 authselect \u72b6\u6001\"<br><br>    if command -v authselect &gt;\/dev\/null 2&gt;&amp;1; then<br>        log_info \"authselect current \u8f93\u51fa\uff1a\"<br>        authselect current || true<br>        echo<br><br>        log_info \"authselect check \u8f93\u51fa\uff1a\"<br>        authselect check || true<br>        echo<br><br>        log_warn \"\u672c\u811a\u672c\u4e0d\u4f9d\u8d56 authselect\uff1b\u53ea\u8981 PAM \u4e2d\u5df2\u52a0\u8f7d pam_pwquality.so\uff0c\u6216\u5141\u8bb8\u63d2\u5165\u8be5\u6a21\u5757\uff0c\u5373\u53ef\u7ee7\u7eed\u6267\u884c\u3002\"<br>    else<br>        log_warn \"\u7cfb\u7edf\u672a\u5b89\u88c5 authselect\uff0c\u7ee7\u7eed\u6309\u624b\u5de5 PAM \u914d\u7f6e\u65b9\u5f0f\u5904\u7406\u3002\"<br>    fi<br>}<br><br>backup_files() {<br>    log_step \"\u5907\u4efd\u914d\u7f6e\u6587\u4ef6\"<br>    mkdir -p \"${BACKUP_DIR}\"<br><br>    for file in \\<br>        \/etc\/pam.d\/system-auth \\<br>        \/etc\/pam.d\/password-auth \\<br>        \"${PWQUALITY_CONF}\" \\<br>        \"${LOGIN_DEFS}\"<br>    do<br>        if [ -f \"$file\" ]; then<br>            cp -a \"$file\" \"${BACKUP_DIR}\/\"<br>            log_info \"\u5df2\u5907\u4efd\uff1a$file\"<br>        fi<br>    done<br><br>    log_info \"\u5907\u4efd\u76ee\u5f55\uff1a${BACKUP_DIR}\"<br>}<br><br>ensure_pam_pwquality() {<br>    local file=\"$1\"<br>    local desired=\"password    requisite     pam_pwquality.so try_first_pass local_users_only retry=${RETRY} authtok_type= enforce_for_root\"<br><br>    if [ ! -f \"$file\" ]; then<br>        log_error \"PAM \u6587\u4ef6\u4e0d\u5b58\u5728\uff1a$file\"<br>        exit 1<br>    fi<br><br>    if grep -q 'pam_pwquality\\.so' \"$file\"; then<br>        log_info \"$file \u5df2\u5b58\u5728 pam_pwquality.so\uff0c\u8865\u9f50\/\u89c4\u8303\u5316\u53c2\u6570\"<br>        sed -ri '\/pam_pwquality\\.so\/c\\'\"$desired\" \"$file\"<br>    else<br>        log_warn \"$file \u672a\u627e\u5230 pam_pwquality.so\uff0c\u81ea\u52a8\u63d2\u5165\u5230 pam_unix.so \u4e4b\u524d\"<br>        awk -v desired=\"$desired\" '<br>            BEGIN { inserted=0 }<br>            {<br>                if (!inserted &amp;&amp; $0 ~ \/^[[:space:]]*password[[:space:]]+.*pam_unix\\.so\/) {<br>                    print desired<br>                    inserted=1<br>                }<br>                print<br>            }<br>            END {<br>                if (!inserted) print desired<br>            }<br>        ' \"$file\" &gt; \"${file}.tmp\"<br>        mv \"${file}.tmp\" \"$file\"<br>    fi<br>}<br><br>configure_pam() {<br>    log_step \"\u914d\u7f6e PAM \u4e2d\u7684 pam_pwquality.so\"<br>    ensure_pam_pwquality \"\/etc\/pam.d\/system-auth\"<br>    ensure_pam_pwquality \"\/etc\/pam.d\/password-auth\"<br>    log_info \"PAM \u914d\u7f6e\u5b8c\u6210\"<br>}<br><br>set_or_add_eq() {<br>    local file=\"$1\"<br>    local key=\"$2\"<br>    local value=\"$3\"<br><br>    if grep -Eq \"^[[:space:]]*${key}[[:space:]]*=\" \"$file\"; then<br>        sed -ri \"s|^[[:space:]]*${key}[[:space:]]*=.*|${key} = ${value}|g\" \"$file\"<br>    else<br>        echo \"${key} = ${value}\" &gt;&gt; \"$file\"<br>    fi<br>}<br><br>set_or_add_space() {<br>    local file=\"$1\"<br>    local key=\"$2\"<br>    local value=\"$3\"<br><br>    if grep -Eq \"^[[:space:]]*${key}[[:space:]]+\" \"$file\"; then<br>        sed -ri \"s|^[[:space:]]*${key}[[:space:]]+.*|${key}   ${value}|g\" \"$file\"<br>    else<br>        echo \"${key}   ${value}\" &gt;&gt; \"$file\"<br>    fi<br>}<br><br>configure_pwquality() {<br>    log_step \"\u914d\u7f6e ${PWQUALITY_CONF}\"<br><br>    touch \"${PWQUALITY_CONF}\"<br><br>    # \u5220\u9664\u53ef\u80fd\u4e0e minclass=3 \u51b2\u7a81\u7684\u663e\u5f0f\u4fe1\u7528\u914d\u7f6e<br>    sed -ri '\/^[[:space:]]*(dcredit|ucredit|lcredit|ocredit)[[:space:]]*=\/d' \"${PWQUALITY_CONF}\"<br><br>    set_or_add_eq \"${PWQUALITY_CONF}\" \"minlen\" \"${MINLEN}\"<br>    set_or_add_eq \"${PWQUALITY_CONF}\" \"minclass\" \"${MINCLASS}\"<br>    set_or_add_eq \"${PWQUALITY_CONF}\" \"difok\" \"${DIFOK}\"<br>    set_or_add_eq \"${PWQUALITY_CONF}\" \"usercheck\" \"1\"<br>    set_or_add_eq \"${PWQUALITY_CONF}\" \"dictcheck\" \"1\"<br><br>    log_info \"pwquality \u914d\u7f6e\u5b8c\u6210\"<br>}<br><br>configure_login_defs() {<br>    log_step \"\u914d\u7f6e ${LOGIN_DEFS}\"<br><br>    set_or_add_space \"${LOGIN_DEFS}\" \"PASS_MAX_DAYS\" \"${PASS_MAX_DAYS}\"<br>    set_or_add_space \"${LOGIN_DEFS}\" \"PASS_MIN_DAYS\" \"${PASS_MIN_DAYS}\"<br>    set_or_add_space \"${LOGIN_DEFS}\" \"PASS_WARN_AGE\" \"${PASS_WARN_AGE}\"<br>    set_or_add_space \"${LOGIN_DEFS}\" \"PASS_MIN_LEN\" \"${PASS_MIN_LEN}\"<br><br>    log_info \"login.defs \u914d\u7f6e\u5b8c\u6210\"<br>}<br><br>apply_password_policy() {<br>    log_step \"\u4e3a\u73b0\u6709\u7528\u6237\u5e94\u7528\u5bc6\u7801\u6709\u6548\u671f\u7b56\u7565\"<br><br>    log_info \"\u5f53\u524d root \u7528\u6237\u5bc6\u7801\u7b56\u7565\uff1a\"<br>    chage -l root || true<br>    echo<br><br>    chage -M \"${PASS_MAX_DAYS}\" -m \"${PASS_MIN_DAYS}\" -W \"${PASS_WARN_AGE}\" root<br>    log_info \"\u5df2\u4e3a root \u8bbe\u7f6e\u5bc6\u7801\u6709\u6548\u671f\"<br><br>    while IFS=: read -r user _ uid _ _ _ _; do<br>        if [ \"$uid\" -ge 1000 ] &amp;&amp; [ \"$uid\" -ne 65534 ]; then<br>            chage -M \"${PASS_MAX_DAYS}\" -m \"${PASS_MIN_DAYS}\" -W \"${PASS_WARN_AGE}\" \"$user\"<br>            log_info \"\u5df2\u8bbe\u7f6e\u7528\u6237 $user \u7684\u5bc6\u7801\u7b56\u7565\"<br>        fi<br>    done &lt; \/etc\/passwd<br>}<br><br>verify_configuration() {<br>    log_step \"\u9a8c\u8bc1\u914d\u7f6e\"<br><br>    echo \"===== PAM \u914d\u7f6e =====\"<br>    grep pam_pwquality.so \/etc\/pam.d\/system-auth \/etc\/pam.d\/password-auth || true<br>    echo<br><br>    echo \"===== pwquality \u914d\u7f6e =====\"<br>    grep -Ev '^[[:space:]]*#|^[[:space:]]*$' \"${PWQUALITY_CONF}\" || true<br>    echo<br><br>    echo \"===== login.defs \u914d\u7f6e =====\"<br>    grep -E '^PASS_(MAX_DAYS|MIN_DAYS|WARN_AGE|MIN_LEN)' \"${LOGIN_DEFS}\" || true<br>    echo<br><br>    echo \"===== root \u7528\u6237\u5bc6\u7801\u7b56\u7565 =====\"<br>    chage -l root || true<br>    echo<br>}<br><br>show_summary() {<br>    log_step \"\u914d\u7f6e\u5b8c\u6210\u6458\u8981\"<br>    echo \"\u6700\u5c0f\u5bc6\u7801\u957f\u5ea6: ${MINLEN}\"<br>    echo \"\u81f3\u5c11\u5b57\u7b26\u7c7b\u578b\u6570: ${MINCLASS}\"<br>    echo \"\u4e0e\u65e7\u5bc6\u7801\u6700\u5c11\u4e0d\u540c\u5b57\u7b26\u6570: ${DIFOK}\"<br>    echo \"\u5bc6\u7801\u6700\u5927\u6709\u6548\u671f: ${PASS_MAX_DAYS} \u5929\"<br>    echo \"\u5bc6\u7801\u6700\u5c0f\u4fee\u6539\u95f4\u9694: ${PASS_MIN_DAYS} \u5929\"<br>    echo \"\u5bc6\u7801\u5230\u671f\u524d\u8b66\u544a: ${PASS_WARN_AGE} \u5929\"<br>    echo \"\u5907\u4efd\u76ee\u5f55: ${BACKUP_DIR}\"<br>    echo<br>    log_info \"\u811a\u672c\u6267\u884c\u5b8c\u6210\"<br>}<br><br>main() {<br>    check_root<br>    check_os<br>    check_managed_auth<br>    install_package<br>    check_authselect<br>    backup_files<br>    configure_pam<br>    configure_pwquality<br>    configure_login_defs<br>    apply_password_policy<br>    verify_configuration<br>    show_summary<br>}<br><br>main \"$@\"<\/pre>\n\n\n\n<p>\u53ea\u7ed9 root \u5e94\u7528\u5df2\u6709\u8d26\u6237\u65f6\u6548\u7b56\u7565\uff1a(\u914d\u7f6e\u5bc6\u7801\u6709\u6548\u671f\u65f6\u8df3\u8fc7root\u7528\u6237)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">APPLY_TO_USERS=root .\/password_policy_anolis89.sh<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE%E5%90%8E%E9%AA%8C%E8%AF%81%E6%B8%85%E5%8D%95\"><\/span><strong>\u914d\u7f6e\u540e\u9a8c\u8bc1\u6e05\u5355<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u2705 \u68c0\u67e5 PAM \u914d\u7f6e<br>grep pam_pwquality.so \/etc\/pam.d\/system-auth<br># \u2705 \u68c0\u67e5 pwquality \u914d\u7f6e<br>cat \/etc\/security\/pwquality.conf | grep -v '^#' | grep -v '^$'<br># \u2705 \u68c0\u67e5\u5bc6\u7801\u6709\u6548\u671f<br>grep PASS_ \/etc\/login.defs | grep -v '^#'<br># \u2705 \u68c0\u67e5root\u7528\u6237\u5bc6\u7801\u7b56\u7565<br>chage -l root<br><br># \u2705 \u6d4b\u8bd5\u5bc6\u7801\u590d\u6742\u5ea6\uff08\u521b\u5efa\u6d4b\u8bd5\u7528\u6237\uff09<br>useradd testpwd<br>passwd testpwd  # \u5c1d\u8bd5\u8f93\u5165 Test@123<br># \u2705 \u68c0\u67e5\u7528\u6237\u5bc6\u7801\u7b56\u7565<br>chage -l testpwd<br># \u4e3a\u5355\u4e2a\u7528\u6237\u914d\u7f6e\u5bc6\u7801\u6709\u6548\u671f<br>chage -M 90 -m 0 -W 7 username<br># \u6279\u91cf\u914d\u7f6e\u591a\u4e2a\u7528\u6237<br>for user in user1 user2 user3; do<br>    chage -M 90 -m 0 -W 7 \"$user\"<br>    echo \"\u5df2\u914d\u7f6e\u7528\u6237: $user\"<br>done<br># \u2705 \u6e05\u7406\u6d4b\u8bd5\u7528\u6237<br>userdel -r testpwd<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Linux%E6%97%A5%E5%BF%97%E5%AE%A1%E8%AE%A1\"><\/span>Linux\u65e5\u5fd7\u5ba1\u8ba1<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>linux\u670d\u52a1\u5668\u5f00\u542f\u65e5\u5fd7\u5ba1\u8ba1\u529f\u80fd\uff0c\u53ef\u5bf9audit\u65e5\u5fd7\u3001messages\u65e5\u5fd7\u3001cron\u65e5\u5fd7\u3001secure\u65e5\u5fd7\u8fdb\u884c\u8bb0\u5f55\uff0c\u670d\u52a1\u5668\u672c\u5730\u65e5\u5fd7\u5ba1\u8ba1\u65f6\u95f4\u9700\u6ee1\u8db36\u4e2a\u6708<\/p>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6848\uff1aLinux\u670d\u52a1\u5668\u914d\u7f6e\u65e5\u5fd7\u8f6e\u8be2\uff0c\u65e2\u4ee5\u5468\u4e3a\u5355\u4f4d\u8f6e\u8be2 26 \u6b21\uff0c\u5373 182\u5929(6\u4e2a\u6708\u5de6\u53f3)\uff0c\u6bcf\u5468\u538b\u7f29\u4fdd\u5b58\u65e5\u5fd7\uff0c\u65e5\u5fd7\u6587\u4ef6\u4ee5\u65e5\u671f\u4f5c\u4e3a\u6269\u5c55\u540d\uff0c\u5ffd\u7565\u9519\u8bef\uff0c\u5ffd\u7565\u7a7a\u6587\u4ef6\uff0c\u5ef6\u8fdf\u538b\u7f29\uff0c\u6700\u7ec8\u8fbe\u5230\u672c\u5730\u65e5\u5fd7\u4fdd\u5b58\u7684\u76ee\u7684\uff0c\u4fdd\u8bc1\u65e5\u5fd7\u5b58\u50a8\u65f6\u95f4\u8fbe\u52306\u4e2a\u6708\u4ee5\u4e0a\u3002<\/p>\n\n\n\n<p>\u624b\u52a8\u914d\u7f6e\u65b9\u6848\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%89%8B%E5%8A%A8%E9%85%8D%E7%BD%AE\"><\/span>\u624b\u52a8\u914d\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE%E5%89%8D%E6%A3%80%E6%9F%A5\"><\/span>\u914d\u7f6e\u524d\u68c0\u67e5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u67e5\u770b\u7cfb\u7edf\u7248\u672c<br>cat \/etc\/os-release<br>cat \/etc\/redhat-release<br># \u4e00\u3001\u5b89\u88c5\u4f9d\u8d56\u5305<br>dnf install -y rsyslog logrotate audit<br># \u68c0\u67e5 rsyslog \u670d\u52a1<br>systemctl status rsyslog<br># \u68c0\u67e5 auditd \u670d\u52a1<br>systemctl status auditd<br># \u6d4b\u8bd5 rsyslog \u914d\u7f6e\u8bed\u6cd5<br>rsyslogd -N1<br># \u67e5\u770b SELinux \u72b6\u6001<br>getenforce<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u4e00\u3001\u5907\u4efd\u539f\u914d\u7f6e<br>cp \/etc\/logrotate.d\/syslog \/etc\/logrotate.d\/syslog.bak.$(date +%Y%m%d)<br># \u4e8c\u3001\u914d\u7f6e rsyslog \u7c7b\u65e5\u5fd7\u8f6e\u8f6c\uff08messages \/ secure \/ cron \/ maillog\uff09<br>cat &gt; \/etc\/logrotate.d\/syslog &lt;&lt; 'EOF'<br>\/var\/log\/cron<br>\/var\/log\/maillog<br>\/var\/log\/messages<br>\/var\/log\/secure<br>{<br>  weekly<br>  rotate 26<br>  create 0600 root root<br>  compress<br>  delaycompress<br>  missingok<br>  notifempty<br>  dateext<br>  dateformat -%Y%m%d<br>  sharedscripts<br>  postrotate<br>    \/bin\/kill -HUP $(cat \/run\/rsyslogd.pid 2&gt;\/dev\/null) 2&gt;\/dev\/null || true<br>  endscript<br>}<br>EOF<br><br># \u6d4b\u8bd5 logrotate \u914d\u7f6e<br>logrotate -dv \/etc\/logrotate.d\/syslog<br><br>#\u4e09\u3001\u914d\u7f6e audit \u65e5\u5fd7\u4fdd\u7559\uff08audit.log\uff09<br># \u5907\u4efd<br>cp \/etc\/audit\/auditd.conf \/etc\/audit\/auditd.conf.bak.$(date +%F)<br><br># \u7f16\u8f91<br>vim \/etc\/audit\/auditd.conf<br><br>log_file = \/var\/log\/audit\/audit.log<br>log_format = RAW<br>flush = INCREMENTAL_ASYNC<br>freq = 100<br><br># \u5355\u4e2a audit \u65e5\u5fd7\u6587\u4ef6\u6700\u5927 100 MB\uff0c\u53ef\u6309\u5b9e\u9645\u8c03\u6574<br>max_log_file = 100<br><br># \u5173\u952e\uff1a\u4fdd\u7559\u65e7\u65e5\u5fd7\uff0c\u4e0d\u8986\u76d6<br>max_log_file_action = keep_logs<br><br># \u5efa\u8bae\u8bbe\u7f6e\u7a7a\u95f4\u9884\u8b66<br>space_left = 25%<br>space_left_action = email<br><br>admin_space_left = 10%<br>admin_space_left_action = single<br><br>disk_full_action = single<br>disk_error_action = syslog<br><br><br><br># \u91cd\u542f rsyslog<br>systemctl restart rsyslog<br><br>systemctl enable auditd<br>service auditd restart<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%AA%8C%E8%AF%81%E9%85%8D%E7%BD%AE-2\"><\/span>\u9a8c\u8bc1\u914d\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u68c0\u67e5 rsyslog \u914d\u7f6e<br>rsyslogd -N1<br><br># \u68c0\u67e5 logrotate<br>logrotate -dv \/etc\/logrotate.d\/syslog | head -20<br><br># \u67e5\u770b auditd \u5173\u952e\u914d\u7f6e<br>grep -E '^(log_file|max_log_file|max_log_file_action|space_left|admin_space_left|disk_full_action|disk_error_action|flush|freq)' \/etc\/audit\/auditd.conf<br><br># \u5199\u5165\u6d4b\u8bd5\u65e5\u5fd7<br>logger \"Final verification - $(date)\"<br>logger -p cron.info \"Final verification - cron\"<br>logger -p auth.info \"Final verification - auth\"<br><br># \u67e5\u770b syslog \u7c7b\u65e5\u5fd7<br>tail -2 \/var\/log\/messages<br>tail -2 \/var\/log\/cron<br>tail -2 \/var\/log\/secure<br><br># \u67e5\u770b auditd \u72b6\u6001<br>auditctl -s<br>ls -lh \/var\/log\/audit\/<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC%EF%BC%9A\"><\/span>\u81ea\u52a8\u5316\u811a\u672c\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><code>setup_log_rotation_anolis89.sh<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#!\/bin\/bash<br># Anolis 8.9 \u65e5\u5fd7\u7559\u5b58\u81ea\u52a8\u5316\u811a\u672c<br># \u8bf4\u660e\uff1a<br># 1. messages \/ secure \/ cron \/ maillog \u4f7f\u7528 logrotate\uff0c\u6bcf\u5468\u8f6e\u8f6c\uff0c\u4fdd\u7559 26 \u5468<br># 2. audit \u65e5\u5fd7\u4f7f\u7528 auditd.conf \u7684 keep_logs \u673a\u5236\uff0c\u4e0d\u5e76\u5165 syslog \u8f6e\u8f6c<br># 3. \u9ed8\u8ba4\u53ea\u505a\u914d\u7f6e\u4e0e\u8bed\u6cd5\u9a8c\u8bc1\uff0c\u4e0d\u5f3a\u5236\u8f6e\u8f6c<br>#<br># \u53ef\u9009\u73af\u5883\u53d8\u91cf\uff1a<br>#   ROTATE_WEEKS=26<br>#   AUDIT_MAX_LOG_FILE_MB=100<br>#   AUDIT_SPACE_LEFT=25%<br>#   AUDIT_ADMIN_SPACE_LEFT=10%<br>#   FORCE_ROTATE_TEST=no   # yes \/ no<br><br>set -Eeuo pipefail<br><br>ROTATE_WEEKS=\"${ROTATE_WEEKS:-26}\"<br>AUDIT_MAX_LOG_FILE_MB=\"${AUDIT_MAX_LOG_FILE_MB:-100}\"<br>AUDIT_SPACE_LEFT=\"${AUDIT_SPACE_LEFT:-25%}\"<br>AUDIT_ADMIN_SPACE_LEFT=\"${AUDIT_ADMIN_SPACE_LEFT:-10%}\"<br>FORCE_ROTATE_TEST=\"${FORCE_ROTATE_TEST:-no}\"<br><br>BACKUP_DIR=\"\/root\/log_policy_backup_$(date +%Y%m%d_%H%M%S)\"<br>SYSLOG_ROTATE_CONF=\"\/etc\/logrotate.d\/syslog\"<br>AUDIT_CONF=\"\/etc\/audit\/auditd.conf\"<br><br>GREEN='\\033[0;32m'<br>YELLOW='\\033[1;33m'<br>RED='\\033[0;31m'<br>BLUE='\\033[0;34m'<br>NC='\\033[0m'<br><br>log_info()  { echo -e \"${GREEN}[INFO]${NC} $*\"; }<br>log_warn()  { echo -e \"${YELLOW}[WARN]${NC} $*\"; }<br>log_error() { echo -e \"${RED}[ERROR]${NC} $*\" &gt;&amp;2; }<br>log_step()  { echo -e \"${BLUE}[STEP]${NC} $*\"; }<br><br>die() {<br>    log_error \"$*\"<br>    exit 1<br>}<br><br>require_root() {<br>    [[ \"$(id -u)\" -eq 0 ]] || die \"\u8bf7\u4ee5 root \u7528\u6237\u8fd0\u884c\u6b64\u811a\u672c\u3002\"<br>}<br><br>detect_os() {<br>    log_step \"\u68c0\u67e5\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\"<br>    [[ -f \/etc\/os-release ]] || die \"\/etc\/os-release \u4e0d\u5b58\u5728\uff0c\u65e0\u6cd5\u8bc6\u522b\u7cfb\u7edf\u3002\"<br><br>    . \/etc\/os-release<br><br>    if [[ \"${ID:-}\" != \"anolis\" ]]; then<br>        log_warn \"\u68c0\u6d4b\u5230 ID=${ID:-unknown}\uff0c\u4e0d\u662f\u6807\u51c6 Anolis\u3002\u5c06\u7ee7\u7eed\u6309 RHEL 8 \u517c\u5bb9\u65b9\u5f0f\u6267\u884c\u3002\"<br>    fi<br><br>    if [[ ! \"${VERSION_ID:-}\" =~ ^8(\\.|$) ]]; then<br>        die \"\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u4e3a ${VERSION_ID:-unknown}\uff0c\u6b64\u811a\u672c\u4ec5\u9002\u914d Anolis\/RHEL 8 \u7cfb\u3002\"<br>    fi<br><br>    log_info \"\u7cfb\u7edf\u8bc6\u522b\u901a\u8fc7\uff1a${PRETTY_NAME:-Anolis 8}\"<br>}<br><br>install_packages() {<br>    log_step \"\u5b89\u88c5\u4f9d\u8d56\u5305\"<br>    dnf -y install rsyslog logrotate audit &gt;\/dev\/null<br>    log_info \"\u4f9d\u8d56\u5b89\u88c5\u5b8c\u6210\u3002\"<br>}<br><br>backup_files() {<br>    log_step \"\u5907\u4efd\u914d\u7f6e\u6587\u4ef6\"<br>    mkdir -p \"${BACKUP_DIR}\"<br>    [[ -f \"${SYSLOG_ROTATE_CONF}\" ]] &amp;&amp; cp -a \"${SYSLOG_ROTATE_CONF}\" \"${BACKUP_DIR}\/\"<br>    [[ -f \"${AUDIT_CONF}\" ]] &amp;&amp; cp -a \"${AUDIT_CONF}\" \"${BACKUP_DIR}\/\"<br>    log_info \"\u5907\u4efd\u5b8c\u6210\uff1a${BACKUP_DIR}\"<br>}<br><br>enable_services() {<br>    log_step \"\u542f\u7528\u5e76\u542f\u52a8\u670d\u52a1\"<br><br>    systemctl enable --now rsyslog &gt;\/dev\/null<br>    systemctl enable auditd &gt;\/dev\/null 2&gt;&amp;1 || true<br>    service auditd start &gt;\/dev\/null 2&gt;&amp;1 || true<br><br>    systemctl is-active rsyslog &gt;\/dev\/null || die \"rsyslog \u542f\u52a8\u5931\u8d25\u3002\"<br>    systemctl is-active auditd &gt;\/dev\/null || log_warn \"auditd \u5f53\u524d\u672a\u5904\u4e8e active\uff0c\u8bf7\u68c0\u67e5\u3002\"<br><br>    log_info \"\u670d\u52a1\u5df2\u5904\u7406\u5b8c\u6210\u3002\"<br>}<br><br>create_log_files() {<br>    log_step \"\u521b\u5efa\/\u6821\u6b63\u65e5\u5fd7\u6587\u4ef6\"<br><br>    touch \/var\/log\/messages \/var\/log\/secure \/var\/log\/cron \/var\/log\/maillog<br>    chmod 600 \/var\/log\/messages \/var\/log\/secure \/var\/log\/cron \/var\/log\/maillog<br>    chown root:root \/var\/log\/messages \/var\/log\/secure \/var\/log\/cron \/var\/log\/maillog<br><br>    mkdir -p \/var\/log\/audit<br>    chmod 700 \/var\/log\/audit<br>    chown root:root \/var\/log\/audit<br><br>    log_info \"\u65e5\u5fd7\u6587\u4ef6\u548c\u76ee\u5f55\u5df2\u6821\u6b63\u3002\"<br>}<br><br>write_syslog_rotate_conf() {<br>    log_step \"\u5199\u5165 ${SYSLOG_ROTATE_CONF}\"<br><br>    cat &gt; \"${SYSLOG_ROTATE_CONF}\" &lt;&lt;EOF<br>\/var\/log\/cron<br>\/var\/log\/maillog<br>\/var\/log\/messages<br>\/var\/log\/secure<br>{<br>  weekly<br>  rotate ${ROTATE_WEEKS}<br>  create 0600 root root<br>  compress<br>  delaycompress<br>  missingok<br>  notifempty<br>  dateext<br>  dateformat -%Y%m%d<br>  sharedscripts<br>  postrotate<br>    \/bin\/kill -HUP \\$(cat \/run\/rsyslogd.pid 2&gt;\/dev\/null) 2&gt;\/dev\/null || true<br>  endscript<br>}<br>EOF<br><br>    log_info \"syslog \u8f6e\u8f6c\u914d\u7f6e\u5df2\u5199\u5165\u3002\"<br>}<br><br>set_kv_eq() {<br>    local file=\"$1\"<br>    local key=\"$2\"<br>    local value=\"$3\"<br><br>    if grep -Eq \"^[[:space:]]*${key}[[:space:]]*=\" \"$file\"; then<br>        sed -ri \"s|^[[:space:]]*${key}[[:space:]]*=.*|${key} = ${value}|g\" \"$file\"<br>    else<br>        printf \"%s = %s\\n\" \"$key\" \"$value\" &gt;&gt; \"$file\"<br>    fi<br>}<br><br>configure_auditd() {<br>    log_step \"\u914d\u7f6e ${AUDIT_CONF}\"<br><br>    touch \"${AUDIT_CONF}\"<br><br>    set_kv_eq \"${AUDIT_CONF}\" \"log_file\" \"\/var\/log\/audit\/audit.log\"<br>    set_kv_eq \"${AUDIT_CONF}\" \"log_format\" \"RAW\"<br>    set_kv_eq \"${AUDIT_CONF}\" \"flush\" \"INCREMENTAL_ASYNC\"<br>    set_kv_eq \"${AUDIT_CONF}\" \"freq\" \"100\"<br><br>    set_kv_eq \"${AUDIT_CONF}\" \"max_log_file\" \"${AUDIT_MAX_LOG_FILE_MB}\"<br>    set_kv_eq \"${AUDIT_CONF}\" \"max_log_file_action\" \"keep_logs\"<br><br>    set_kv_eq \"${AUDIT_CONF}\" \"space_left\" \"${AUDIT_SPACE_LEFT}\"<br>    set_kv_eq \"${AUDIT_CONF}\" \"space_left_action\" \"email\"<br><br>    set_kv_eq \"${AUDIT_CONF}\" \"admin_space_left\" \"${AUDIT_ADMIN_SPACE_LEFT}\"<br>    set_kv_eq \"${AUDIT_CONF}\" \"admin_space_left_action\" \"single\"<br><br>    set_kv_eq \"${AUDIT_CONF}\" \"disk_full_action\" \"single\"<br>    set_kv_eq \"${AUDIT_CONF}\" \"disk_error_action\" \"syslog\"<br><br>    log_info \"auditd \u914d\u7f6e\u5df2\u5b8c\u6210\u3002\"<br>}<br><br>pre_checks() {<br>    log_step \"\u57fa\u7840\u68c0\u67e5\"<br><br>    echo \"===== \u7cfb\u7edf\u7248\u672c =====\"<br>    cat \/etc\/os-release<br>    echo<br><br>    echo \"===== rsyslog \u670d\u52a1\u72b6\u6001 =====\"<br>    systemctl status rsyslog --no-pager || true<br>    echo<br><br>    echo \"===== auditd \u670d\u52a1\u72b6\u6001 =====\"<br>    service auditd status || systemctl status auditd --no-pager || true<br>    echo<br><br>    echo \"===== rsyslog \u8bed\u6cd5\u68c0\u67e5 =====\"<br>    rsyslogd -N1 || die \"rsyslog \u914d\u7f6e\u8bed\u6cd5\u68c0\u67e5\u5931\u8d25\u3002\"<br>    echo<br><br>    echo \"===== \u5f53\u524d SELinux \u72b6\u6001 =====\"<br>    getenforce || true<br>    echo<br><br>    if findmnt \/var\/log\/audit &gt;\/dev\/null 2&gt;&amp;1; then<br>        log_info \"\/var\/log\/audit \u5df2\u5355\u72ec\u6302\u8f7d\u3002\"<br>    else<br>        log_warn \"\/var\/log\/audit \u672a\u5355\u72ec\u6302\u8f7d\u3002\u82e5 audit \u91cf\u8f83\u5927\uff0c\u5efa\u8bae\u5355\u72ec\u5206\u533a\u4ee5\u4fbf\u4fdd\u7559 6 \u4e2a\u6708\u3002\"<br>    fi<br>}<br><br>restart_services() {<br>    log_step \"\u91cd\u542f\u670d\u52a1\"<br><br>    systemctl restart rsyslog<br>    service auditd restart &gt;\/dev\/null 2&gt;&amp;1 || true<br><br>    systemctl is-active rsyslog &gt;\/dev\/null || die \"rsyslog \u91cd\u542f\u5931\u8d25\u3002\"<br>    systemctl is-active auditd &gt;\/dev\/null || log_warn \"auditd \u91cd\u542f\u540e\u672a\u5904\u4e8e active\uff0c\u8bf7\u68c0\u67e5\u3002\"<br><br>    log_info \"\u670d\u52a1\u91cd\u542f\u5b8c\u6210\u3002\"<br>}<br><br>test_logging() {<br>    log_step \"\u5199\u5165\u6d4b\u8bd5\u65e5\u5fd7\"<br><br>    logger \"Anolis log policy verification - $(date '+%F %T')\"<br>    logger -p auth.info \"Anolis secure verification - $(date '+%F %T')\"<br>    logger -p cron.info \"Anolis cron verification - $(date '+%F %T')\"<br>    logger -p mail.info \"Anolis mail verification - $(date '+%F %T')\"<br><br>    sleep 2<br><br>    echo \"===== messages =====\"<br>    tail -3 \/var\/log\/messages || true<br>    echo<br><br>    echo \"===== secure =====\"<br>    tail -3 \/var\/log\/secure || true<br>    echo<br><br>    echo \"===== cron =====\"<br>    tail -3 \/var\/log\/cron || true<br>    echo<br><br>    echo \"===== maillog =====\"<br>    tail -3 \/var\/log\/maillog || true<br>    echo<br>}<br><br>verify_logrotate() {<br>    log_step \"\u9a8c\u8bc1 logrotate \u914d\u7f6e\"<br>    logrotate -dv \"${SYSLOG_ROTATE_CONF}\" | head -30 || true<br>    echo<br>}<br><br>verify_auditd() {<br>    log_step \"\u9a8c\u8bc1 auditd \u914d\u7f6e\"<br><br>    echo \"===== auditd \u5173\u952e\u914d\u7f6e =====\"<br>    grep -E '^(log_file|log_format|flush|freq|max_log_file|max_log_file_action|space_left|space_left_action|admin_space_left|admin_space_left_action|disk_full_action|disk_error_action)' \"${AUDIT_CONF}\" || true<br>    echo<br><br>    echo \"===== auditctl -s =====\"<br>    auditctl -s || true<br>    echo<br><br>    echo \"===== \/var\/log\/audit =====\"<br>    ls -lh \/var\/log\/audit\/ || true<br>    echo<br>}<br><br>force_rotate_if_requested() {<br>    if [[ \"${FORCE_ROTATE_TEST}\" == \"yes\" ]]; then<br>        log_step \"\u6267\u884c\u5f3a\u5236\u8f6e\u8f6c\u6d4b\u8bd5\"<br>        logrotate -fv \"${SYSLOG_ROTATE_CONF}\" || log_warn \"\u5f3a\u5236\u8f6e\u8f6c\u8fd4\u56de\u975e 0\uff0c\u8bf7\u4eba\u5de5\u68c0\u67e5\u3002\"<br>        echo<br>        ls -lht \/var\/log\/messages* \/var\/log\/secure* \/var\/log\/cron* \/var\/log\/maillog* 2&gt;\/dev\/null | head -20 || true<br>        echo<br>    else<br>        log_info \"\u5df2\u8df3\u8fc7\u5f3a\u5236\u8f6e\u8f6c\u6d4b\u8bd5\u3002\u9700\u8981\u65f6\u53ef\u4f7f\u7528 FORCE_ROTATE_TEST=yes \u518d\u8fd0\u884c\u4e00\u6b21\u3002\"<br>    fi<br>}<br><br>show_summary() {<br>    log_step \"\u914d\u7f6e\u5b8c\u6210\u6458\u8981\"<br>    echo \"syslog \u8f6e\u8f6c\u5468\u671f: weekly\"<br>    echo \"syslog \u4fdd\u7559\u8f6e\u6570: ${ROTATE_WEEKS}\"<br>    echo \"audit \u5355\u6587\u4ef6\u5927\u5c0f: ${AUDIT_MAX_LOG_FILE_MB} MB\"<br>    echo \"audit \u8fbe\u5230\u4e0a\u9650\u52a8\u4f5c: keep_logs\"<br>    echo \"\u5907\u4efd\u76ee\u5f55: ${BACKUP_DIR}\"<br>}<br><br>main() {<br>    require_root<br>    detect_os<br>    install_packages<br>    backup_files<br>    enable_services<br>    pre_checks<br>    create_log_files<br>    write_syslog_rotate_conf<br>    configure_auditd<br>    restart_services<br>    test_logging<br>    verify_logrotate<br>    verify_auditd<br>    force_rotate_if_requested<br>    show_summary<br>    log_info \"\u5168\u90e8\u5b8c\u6210\u3002\"<br>}<br><br>main \"$@\"<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81\"><\/span>\u6d4b\u8bd5\u9a8c\u8bc1<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">ls -lh \/var\/log\/{messages,secure,cron,maillog}* &amp;&amp; cat \/etc\/logrotate.d\/syslog &amp;&amp; hostname -I <\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows \u914d\u7f6e\u65e5\u5fd7 \u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7\u3001\u5b89\u5168\u65e5\u5fd7\u548c\u7cfb\u7edf\u4e0a\u4f20\u65e5\u5fd7\u5ba1\u8ba1\uff0c\u65e5\u5fd7\u7559\u5b58\u65f6\u95f4\u9700\u6ee1\u8db36\u4e2a\u6708\u3002 \u89e3\u51b3\u65b9\u6848\uff1a\u5efa\u8bae [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3181","post","type-post","status-publish","format-standard","hentry","category-vxhs888p"],"_links":{"self":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/3181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3181"}],"version-history":[{"count":1,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/3181\/revisions"}],"predecessor-version":[{"id":3182,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/3181\/revisions\/3182"}],"wp:attachment":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}