{"id":3165,"date":"2012-06-26T09:31:45","date_gmt":"2012-06-26T01:31:45","guid":{"rendered":"http:\/\/jpuyy.com\/?p=3165"},"modified":"2013-01-10T21:52:50","modified_gmt":"2013-01-10T13:52:50","slug":"samba-configure-file-separately","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=3165","title":{"rendered":"samba\u914d\u7f6e\u6587\u4ef6\u5206\u5e03\u5f0f\u5199\u6cd5"},"content":{"rendered":"<p>\u8981\u6c42\uff1a\u6709\u4e24\u4e2a\u90e8\u95e8A\u548cB\uff0c\u5206\u522b\u5206\u914d\u4e00\u4e2a\u533a\uff0cA\u90e8\u95e8\u4eba\u5458\u4e0d\u80fd\u770b\u5230B\u533a\uff0cB\u90e8\u95e8\u4eba\u5458\u4e5f\u4e0d\u80fd\u770b\u5230A\u533a\uff0c\u540c\u65f6\u6709\u5171\u4eab\u533ashare\uff0c\u4e24\u90e8\u95e8\u90fd\u53ef\u4ee5\u81ea\u7531\u4f7f\u7528\u3002<\/p>\n<p>\u5982\u679c\u4e0d\u91c7\u7528\u5206\u5e03\u5f0f\u5199\u6cd5\uff0c\u5219\u7528\u6237\u80fd\u770b\u5230\u6240\u6709\u533a\uff0c\u4f46\u53ea\u80fd\u8fdb\u5165\u6709\u6743\u9650\u7684\u533a\uff0c\u867d\u53ef\u5b9e\u73b0\u4f7f\u7528\uff0c\u4f46\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u53ea\u8981\u6309\u76f8\u540c\u7684\u65b9\u6cd5\uff0c\u5206\u5e03\u5f0f\u5199\u914d\u7f6e\u6587\u4ef6\uff0c\u53ef\u63a7\u5236samba\u7528\u6237\u53ea\u770b\u5230\u81ea\u5df1\u6709\u8bfb\u6743\u9650\u7684\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u3002<\/p>\n<p>vi \/etc\/samba\/smb.conf<\/p>\n<p>#%U\u4ee3\u8868\u5355\u72ec\u7528\u6237,%G\u4ee3\u8868\u7528\u6237\u7ec4\u7684\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>include = \/etc\/samba\/smb.conf.%U<br \/>\ninclude = \/etc\/samba\/smb.conf.%G<\/p>\n<p>\u8fd9\u65f6\u6211jpuyy\uff0c\u5982\u679c\u5728A\u7ec4\uff0c\u5219\u628a\u6211\u52a0\u5165\u5230A\u7684\u7528\u6237\u7ec4\u91cc\uff0c\u5173\u952e\u70b9\uff0c\u662f\u5c06jpuyy\u7684<code>\u9996\u9009\u7ec4<\/code>\u8bbe\u4e3aA\uff0c\uff08\u5982\u679c\u4e0d\u8fd9\u6837\uff0c\u53ef\u80fd\u4f1a\u4ea7\u751f\u770b\u4e0d\u5230A\u7684\u60c5\u51b5\uff09\uff0c\u547d\u4ee4\u662f\uff1a<\/p>\n<pre>usermod -g A jpuyy<\/pre>\n<p>\u7136\u540e\u5728 \/etc\/samba\/\u4e0b\u6dfb\u52a0\u4e00\u4e2aA\u7ec4\u7684\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>vim smb.conf.A<\/p>\n<p>\u6dfb\u52a0<\/p>\n<p>[A-\u8bfb\u5199]<br \/>\ncomment = A\u533a<br \/>\npath = \/home\/data\/A<br \/>\nvalid users = @A<br \/>\nwrite list = @A<\/p>\n<p>\u5f53\u7136\u4e5f\u53ef\u4ee5\u9488\u5bf9\u7528\u6237\u6765\u5199\uff0c\u540c\u7406\u5c31\u662f\u89c4\u5b9a\u4e86\u8fd9\u4e2a\u7528\u6237\u7684\u6743\u9650\u4e86\u3002<\/p>\n<p>\u53c2\u8003\uff1a<a href=\"http:\/\/www.samba.org\/samba\/docs\/man\/manpages-3\/smb.conf.5.html\">http:\/\/www.samba.org\/samba\/docs\/man\/manpages-3\/smb.conf.5.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u6c42\uff1a\u6709\u4e24\u4e2a\u90e8\u95e8A\u548cB\uff0c\u5206\u522b\u5206\u914d\u4e00\u4e2a\u533a\uff0cA\u90e8\u95e8\u4eba\u5458\u4e0d\u80fd\u770b\u5230B\u533a\uff0cB\u90e8\u95e8\u4eba\u5458\u4e5f\u4e0d\u80fd\u770b\u5230A\u533a\uff0c\u540c\u65f6\u6709\u5171\u4eab\u533ashare\uff0c\u4e24\u90e8\u95e8\u90fd\u53ef\u4ee5\u81ea\u7531\u4f7f\u7528\u3002 \u5982\u679c\u4e0d\u91c7\u7528\u5206\u5e03\u5f0f\u5199\u6cd5\uff0c\u5219\u7528\u6237\u80fd\u770b\u5230\u6240\u6709\u533a\uff0c\u4f46\u53ea\u80fd\u8fdb\u5165\u6709\u6743\u9650\u7684\u533a\uff0c\u867d\u53ef\u5b9e\u73b0\u4f7f\u7528\uff0c\u4f46\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u53ea\u8981\u6309\u76f8\u540c\u7684\u65b9\u6cd5\uff0c\u5206\u5e03\u5f0f\u5199\u914d\u7f6e\u6587\u4ef6\uff0c\u53ef\u63a7\u5236samba\u7528\u6237\u53ea\u770b\u5230\u81ea\u5df1\u6709\u8bfb\u6743\u9650\u7684\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u3002 vi \/etc\/samba\/smb.conf #%U\u4ee3\u8868\u5355\u72ec\u7528\u6237,%G\u4ee3\u8868\u7528\u6237\u7ec4\u7684\u914d\u7f6e\u6587\u4ef6 include = \/etc\/samba\/smb.conf.%U include = \/etc\/samba\/smb.conf.%G \u8fd9\u65f6\u6211jpuyy\uff0c\u5982\u679c\u5728A\u7ec4\uff0c\u5219\u628a\u6211\u52a0\u5165\u5230A\u7684\u7528\u6237\u7ec4\u91cc\uff0c\u5173\u952e\u70b9\uff0c\u662f\u5c06jpuyy\u7684\u9996\u9009\u7ec4\u8bbe\u4e3aA\uff0c\uff08\u5982\u679c\u4e0d\u8fd9\u6837\uff0c\u53ef\u80fd\u4f1a\u4ea7\u751f\u770b\u4e0d\u5230A\u7684\u60c5\u51b5\uff09\uff0c\u547d\u4ee4\u662f\uff1a usermod -g A jpuyy \u7136\u540e\u5728 \/etc\/samba\/\u4e0b\u6dfb\u52a0\u4e00\u4e2aA\u7ec4\u7684\u914d\u7f6e\u6587\u4ef6 vim smb.conf.A \u6dfb\u52a0 [A-\u8bfb\u5199] comment = A\u533a path = \/home\/data\/A valid users = @A write list = @A \u5f53\u7136\u4e5f\u53ef\u4ee5\u9488\u5bf9\u7528\u6237\u6765\u5199\uff0c\u540c\u7406\u5c31\u662f\u89c4\u5b9a\u4e86\u8fd9\u4e2a\u7528\u6237\u7684\u6743\u9650\u4e86\u3002 \u53c2\u8003\uff1ahttp:\/\/www.samba.org\/samba\/docs\/man\/manpages-3\/smb.conf.5.html<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-3165","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3165"}],"version-history":[{"count":5,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3165\/revisions"}],"predecessor-version":[{"id":3265,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3165\/revisions\/3265"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}