{"id":171,"date":"2006-12-27T15:43:29","date_gmt":"2006-12-27T15:43:29","guid":{"rendered":"http:\/\/www.jason695.idv.tw:81\/wordpress\/?p=171"},"modified":"2016-08-04T13:41:55","modified_gmt":"2016-08-04T05:41:55","slug":"%e8%bd%89%e8%b2%bcapache-password-access-protection","status":"publish","type":"post","link":"https:\/\/jason695.why3s.tw\/wordpress\/2006\/12\/27\/%e8%bd%89%e8%b2%bcapache-password-access-protection\/","title":{"rendered":"[\u8f49\u8cbc]Apache, password access protection"},"content":{"rendered":"<p>\u4e5d\u6708 21, 2004 @ 8:31 am  \t\t\t\u00b7 Filed under UNIX, FreeBSD<\/p>\n<p class=\"postmeta\">\n<div class=\"postentry\">\u7db2\u7ad9\u4e0a\u7684\u7db2\u9801, \u4e00\u822c\u8aaa\u4f86\u90fd\u662f\u958b\u653e\u7d66\u6240\u6709\u4eba\u4f86\u700f\u89bd, \u4f46\u662f\u6709\u6642\u5019,<br \/>\n\u67d0\u4e9b\u7db2\u9801\u5e0c\u671b\u53ea\u8b93\u7279\u5b9a\u7684\u4eba\u700f\u89bd,<br \/>\n\u6b64\u6642\u53ef\u5229\u7528\u5bc6\u78bc\u78ba\u8a8d\u8207\u4f86\u6e90 IP \u7ba1\u5236\u9019\u5169\u7a2e\u65b9\u5f0f\u4f86\u904e\u6ffe\u4f7f\u7528\u8005.<br \/>\n\u8981\u5c0d\u700f\u89bd\u7db2\u9801\u7684\u4eba\u4f5c\u5bc6\u78bc\u78ba\u8a8d\u8207\u4f86\u6e90 IP \u7ba1\u5236, \u6700\u7c21\u55ae\u7684\u5c31\u662f\u900f\u904e .htaccess \u4e86.<\/p>\n<p>** \u900f\u904e .htaccess \u66ff\u7db2\u9801\u4f5c\u5bc6\u78bc\u4fdd\u8b77 **<\/p>\n<p>\u9996\u5148\u5728\u8981\u7528\u5bc6\u78bc\u4f86\u4fdd\u8b77\u7684\u76ee\u9304\u4e0b\u5efa\u7acb\u4e00\u500b .htaccess \u7684\u6a94\u6848, \u5167\u5bb9\u5982\u4e0b:<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br \/>\nAuthUserFile \/user1\/staff\/tung\/public_html\/secure\/.passwd<br \/>\nAuthGroupFile \/dev\/null<br \/>\nAuthName \u201caccess\u201d<br \/>\nAuthType Basic<\/p>\n<p>require valid-user  \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013\u4e0a\u9762\u9019\u500b\u6a94\u6848\u6703\u628a\u6574\u500b security \u76ee\u9304 (\u542b\u6240\u6709\u5b50\u76ee\u9304),<br \/>\n\u90fd\u7528\u6307\u5b9a\u7684 .passwd \u4fdd\u8b77\u8d77\u4f86, \u4efb\u4f55\u60f3\u8981\u700f\u89bd security \u76ee\u9304\u5167\u7db2\u9801\u7684\u4eba,<br \/>\n\u90fd\u5fc5\u9808\u8f38\u5165\u6b63\u78ba\u7684\u4f7f\u7528\u8005\u540d\u7a31\u8207\u5bc6\u78bc\u624d\u884c.<\/p>\n<p>** \u5efa\u7acb .passwd \u9019\u500b\u5bc6\u78bc\u6a94 **<\/p>\n<p>cd security<br \/>\nhtpasswd -c .passwd test<br \/>\n\u7136\u5f8c\u8f38\u5165\u4e00\u7d44\u5bc6\u78bc, \u4e0a\u9762\u9019\u500b\u547d\u4ee4\u6703\u5efa\u7acb .passwd \u9019\u500b\u6a94, \u4e26\u653e\u5165\u4f7f\u7528\u8005 test \u8207\u5176\u5bc6\u78bc.<\/p>\n<p>\u5982\u679c\u4f60\u5e0c\u671b\u591a\u653e\u5e7e\u500b\u4f7f\u7528\u8005\u5230\u5bc6\u78bc\u6a94\u88e1, \u90a3\u9ebc\u7e7c\u7e8c:<br \/>\nhtpasswd .passwd test2<br \/>\n\u4e26\u8f38\u5165 test2 \u7684\u5bc6\u78bc.<\/p>\n<p>\u8981\u6ce8\u610f\u53ea\u6709\u5728\u7b2c\u4e00\u6b21\u6642\u624d\u8981\u7528 -c \u9019\u500b\u53c3\u6578, \u5b83\u4ee3\u8868\u91cd\u65b0\u5efa\u7acb\u4e00\u500b\u5bc6\u78bc\u6a94,<br \/>\n\u5982\u679c\u5728\u5bc6\u78bc\u6a94\u5df2\u5b58\u5728\u7684\u60c5\u5f62\u4e0b\u4f7f\u7528 -c \u9019\u500b\u53c3\u6578, \u5bc6\u78bc\u6a94\u820a\u6709\u8a18\u9304\u6703\u88ab\u6e05\u9664.<\/p>\n<p>.passwd \u6a94\u6848\u662f\u4e00\u500b\u666e\u901a\u7684\u6587\u5b57\u6a94, \u4f60\u53ef\u4ee5\u7528\u4e00\u822c\u7684\u6587\u66f8\u7de8\u8f2f\u5668\u53bb\u8655\u7406\u5b83,<br \/>\n\u522a\u9664\u4e0d\u8981\u7684\u4f7f\u7528\u8005\u540d\u7a31\u8207\u5bc6\u78bc.<\/p>\n<p>\u6700\u5f8c\u5c07\u8981\u88ab\u4fdd\u8b77\u7684\u7db2\u9801\u653e\u5230 .htaccess \u6240\u5728\u7684\u5b50\u76ee\u9304\u4e2d\u5373\u53ef.<\/p>\n<p>** \u900f\u904e .htaccess \u66ff\u7db2\u9801\u4f5c\u4f86\u6e90 IP \u7ba1\u5236 **<\/p>\n<p>\u6bd4\u5982\u8aaa\u4f60\u5e0c\u671b\u53ea\u6709\u4f86\u81ea *.ncku.edu.tw \u6216\u662f 140.116.* \u7684\u4f7f\u7528\u8005\u624d\u80fd\u700f\u89bd\u4f60\u7684\u7db2\u9801,<br \/>\n\u8acb\u5728\u4e0a\u8ff0\u7684 .htaccess \u6a94\u6848\u4e2d, \u52a0\u5165\u4e0b\u5217\u7247\u6bb5\u5373\u53ef:<\/p>\n<p>order deny,allow<br \/>\ndeny from all<br \/>\nallow from .ncku.edu.tw<br \/>\nallow from 140.116.\u5982\u679c\u4f60\u8981\u4fdd\u8b77\u7684\u662f CGI \u7a0b\u5f0f\u6240\u5728\u7684\u76ee\u9304, \u9664\u4e86\u8981\u7522\u751f\u4e0a\u8ff0\u7684 .htaccess \u6a94\u6848\u5916,<br \/>\n\u9084\u8981\u628a  \u9019\u884c\u6539\u6210   \u624d\u884c.<\/p>\n<p>\u6709\u95dc .htaccess \u6a94\u6848\u4e4b\u66f4\u8a73\u7d30\u8aaa\u660e, \u8acb\u53c3\u8003:<br \/>\nhttp:\/\/hoohoo.ncsa.uiuc.edu\/docs\/tutorials\/user.html<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e5d\u6708 21, 2004 @ 8:31 am \u00b7 Filed under UNIX, FreeBSD \u7db2\u7ad9\u4e0a\u7684\u7db2 &hellip; <a href=\"https:\/\/jason695.why3s.tw\/wordpress\/2006\/12\/27\/%e8%bd%89%e8%b2%bcapache-password-access-protection\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587 <span class=\"screen-reader-text\">[\u8f49\u8cbc]Apache, password access protection<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[],"class_list":["post-171","post","type-post","status-publish","format-standard","hentry","category-29","no-featured-image"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":0,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/171\/revisions"}],"wp:attachment":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/media?parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/categories?post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/tags?post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}