{"id":15874,"date":"2025-04-18T22:22:41","date_gmt":"2025-04-18T14:22:41","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/15874.html"},"modified":"2025-04-18T22:22:41","modified_gmt":"2025-04-18T14:22:41","slug":"%e9%85%8d%e7%bd%ae%e4%b8%8e%e7%ae%a1%e7%90%86samba%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%9e%e8%b7%b5%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/15874.html","title":{"rendered":"\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09"},"content":{"rendered":"<\/p>\n<h4>\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668<\/h4>\n<ul>\n<li>\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668<\/li>\n<li>\u4e00\u3001\u9879\u76ee\u63cf\u8ff0<\/li>\n<li>\u4e8c\u3001\u9879\u76ee\u5b9e\u65bd<\/li>\n<li>\n<ul>\n<li>(\u4e00&#xff09;\u5b89\u88c5Samba\u670d\u52a1\u5668\u7aef<\/li>\n<li>(\u4e8c&#xff09;\u521b\u5efa\u6587\u4ef6\u5939<\/li>\n<li>(\u4e09&#xff09;\u521b\u5efa\u7528\u6237\u7ec4<\/li>\n<li>(\u56db&#xff09;\u521b\u5efa\u7528\u6237\u5e76\u5212\u5c06\u7528\u6237\u6dfb\u52a0\u5230\u7ec4<\/li>\n<li>(\u4e94&#xff09;\u6dfb\u52a0\u7528\u6237\u8bbf\u95ee\u6743\u9650<\/li>\n<li>\n<ul>\n<li>&#xff08;1&#xff09;\u4fee\u6539\u5404\u90e8\u95e8\u7684\u6587\u4ef6\u5f52\u5c5e\u548c\u6743\u9650<\/li>\n<li>&#xff08;2&#xff09;\u4fee\u6539\u516c\u5171\u6587\u4ef6\u5939\u5c5e\u6027<\/li>\n<li>&#xff08;3&#xff09;\u8bbe\u7f6e\u8bbf\u95ee\u63a7\u5236\u5217\u8868<\/li>\n<li>(4)\u67e5\u770b\u6587\u4ef6\u5939\u7684\u6743\u9650<\/li>\n<li>\u5c0f\u77e5\u8bc6 &#xff1a;\u6587\u4ef6\u5939\u6743\u9650\u8868\u793a<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001Samba\u670d\u52a1\u5668\u7684\u914d\u7f6e<\/li>\n<li>\n<ul>\n<li>(\u4e00&#xff09;\u5907\u4efdsamba\u914d\u7f6e\u6587\u4ef6<\/li>\n<li>&#xff08;\u4e8c&#xff09;\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/li>\n<li>\n<ul>\n<li>\u9632\u706b\u5899\u8bbe\u7f6esamba\u901a\u884c<\/li>\n<li>\u8bbe\u7f6eselinux (\u4ee5\u4e0b\u4e24\u4e2a\u547d\u4ee4\u884c&#xff0c;\u5728\/etc\/samba\/smb.conf.example\u6587\u4ef6\u4e2d&#xff09;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u56db\u3001\u521b\u5efasamba\u8bbf\u95ee\u7528\u6237<\/li>\n<li>\u4e94\u3001Linux\u4e2d\u4f7f\u7528samba\u5ba2\u6237\u7aef\u8bbf\u95ee<\/li>\n<li>\u516d\u3001windows\u5ba2\u6237\u7aef\u8bbf\u95ee<\/li>\n<li>\u603b\u7ed3<\/li>\n<\/ul>\n<h2>\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668<\/h2>\n<h2>\u4e00\u3001\u9879\u76ee\u63cf\u8ff0<\/h2>\n<p>\u67d0\u4f01\u4e1a\u6709\u884c\u653f\u7ba1\u7406\u3001\u7814\u53d1\u90e8\u3001\u4ea7\u54c1\u90e8\u3001\u6d4b\u8bd5\u90e8\u548c\u9500\u552e\u90e8\u51715\u4e2a\u90e8\u95e8\u3002\u529e\u516c\u7528\u8ba1\u7b97\u673a\u64cd\u4f5c\u7cfb\u7edf\u4e3aWindows 11&#xff0c;\u90e8\u5206\u7814\u53d1\u4eba\u5458\u4f7f\u7528Linux\u64cd\u4f5c\u7cfb\u7edf&#xff0c;\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u662f\u7edf\u4fe1UOS20\u3002\u73b0\u9700\u8981\u8bbe\u8ba1\u4e00\u5957\u5efa\u7acb\u5728UOS20\u4e4b\u4e0a\u7684\u57fa\u4e8eSamba\u7684\u5b89\u5168\u6587\u4ef6\u5171\u4eab\u65b9\u6848\u3002 \u8981\u6c42&#xff1a; &#xff08;1&#xff09;\u4f01\u4e1a\u5185\u6bcf\u4e2a\u7528\u6237\u90fd\u6709\u81ea\u5df1\u7684\u7f51\u7edc\u78c1\u76d8 &#xff08;2&#xff09;\u7814\u53d1\u90e8\u548c\u6d4b\u8bd5\u90e8\u6709\u5171\u7528\u7684\u7f51\u7edc\u786c\u76d8 &#xff08;3&#xff09;\u6240\u6709\u7528\u6237(\u5305\u62ec\u533f\u540d\u7528\u6237)\u6709\u4e00\u4e2a\u53ea\u8bfb\u5171\u4eab\u8d44\u6599\u5e93 &#xff08;4&#xff09;\u6240\u6709\u7528\u6237(\u5305\u62ec\u533f\u540d\u7528\u6237)\u8981\u6709\u4e00\u4e2a\u5b58\u653e\u4e34\u65f6\u6587\u4ef6\u7684\u6587\u4ef6\u5939\u3002<\/p>\n<p>samba\u670d\u52a1\u5668\u7684IP\u5730\u5740\u4e3a&#xff1a;192.168.\u5b66\u53f7.200, &#xff08;1&#xff09;\u884c\u653f\u7ba1\u7406\u90e8\u5177\u6709\u7ba1\u7406\u6240\u6709samba\u7a7a\u95f4\u7684\u6743\u9650\u3002 &#xff08;2&#xff09;\u5404\u90e8\u95e8\u7684\u79c1\u6709\u7a7a\u95f4&#xff1a;\u5404\u90e8\u95e8\u62e5\u6709\u81ea\u5df1\u7684\u7a7a\u95f4&#xff0c;\u9664\u4e86\u90e8\u95e8\u6210\u5458\u53ca\u884c\u653f\u7ba1\u7406\u90e8\u6709\u6743\u9650\u4ee5\u5916&#xff0c;\u5176\u4ed6\u7528\u6237\u6ca1\u6709\u6743\u9650&#xff08;\u5305\u62ec\u5217\u8868\u3001\u8bfb\u548c\u5199\u7b49&#xff09;\u8bbf\u95ee\u3002 &#xff08;3&#xff09;\u8d44\u6599\u5e93&#xff1a;\u6240\u6709\u7528\u6237&#xff08;\u5305\u62ec\u533f\u540d\u7528\u6237&#xff09;\u90fd\u5177\u6709\u8bfb\u6743\u9650\u800c\u4e0d\u5177\u6709\u5199\u5165\u6570\u636e\u7684\u6743\u9650\u3002 &#xff08;4&#xff09;\u7814\u53d1\u90e8\u4e0e\u6d4b\u8bd5\u90e8\u7684\u5171\u4eab\u7a7a\u95f4&#xff0c;\u7814\u53d1\u90e8\u4e0e\u6d4b\u8bd5\u90e8\u4e4b\u5916\u7684\u7528\u6237\u4e0d\u80fd\u8bbf\u95ee\u3002 &#xff08;5&#xff09;\u516c\u5171\u4e34\u65f6\u7a7a\u95f4&#xff1a;\u6240\u6709\u7528\u6237\u90fd\u53ef\u4ee5\u8bfb\u53d6\u3001\u5199\u5165\u3001\u5220\u9664\u3002<\/p>\n<p>\u9879\u76ee\u5b9e\u65bd\u8981\u6c42&#xff1a; &#xff08;1&#xff09;\u8bbe\u8ba1samba\u7684\u5b89\u5168\u6587\u4ef6\u5171\u4eab\u65b9\u6848&#xff0c;\u5f62\u6210\u4ea4\u4ed8\u6587\u6863 &#xff08;2&#xff09;\u7f16\u5236\u672c\u9879\u76ee\u7684\u6267\u884c\u811a\u672c\u3001\u4fee\u6539\u76f8\u5173\u914d\u7f6e\u6587\u4ef6 &#xff08;3&#xff09;\u63d0\u4ea4\u4ea4\u4ed8\u6587\u6863\u3001\u6267\u884c\u811a \u672c\u3001\u76f8\u5173\u914d\u7f6e\u6587\u4ef6\u548c\u5173\u952e\u6b65\u9aa4\u622a\u56fe\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418142240-680260308d4d6.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>\u4e8c\u3001\u9879\u76ee\u5b9e\u65bd<\/h2>\n<p>\u5728\u6839\u76ee\u5f55\u4e0b\u521b\u5efa\u5171\u4eab\u76ee\u5f55 \/share \u884c\u653f\u7ba1\u7406\u3001\u7814\u53d1\u90e8\u3001\u4ea7\u54c1\u90e8\u3001\u6d4b\u8bd5\u90e8\u548c\u9500\u552e\u90e8 \u4e3a\u5404\u90e8\u95e8\u521b\u65b0\u6587\u4ef6\u5939&#xff0c;\u5206\u522b\u4e3a system\u3001develop\u3001product\u3001test\u3001sales\u3001developandtest\u3001ziliaoku\u3001public<\/p>\n<h3>(\u4e00&#xff09;\u5b89\u88c5Samba\u670d\u52a1\u5668\u7aef<\/h3>\n<p>yum <span class=\"token function\">install<\/span> samba -y<br \/>\nsystemctl start smb<br \/>\nsystemctl <span class=\"token builtin class-name\">enable<\/span> smb<\/p>\n<h3>(\u4e8c&#xff09;\u521b\u5efa\u6587\u4ef6\u5939<\/h3>\n<p><span class=\"token function\">mkdir<\/span> \/share<br \/>\n<span class=\"token builtin class-name\">cd<\/span> \/share<br \/>\n<span class=\"token function\">mkdir<\/span> system develop product <span class=\"token builtin class-name\">test<\/span> sales developandtest ziliaoku public<\/p>\n<h3>(\u4e09&#xff09;\u521b\u5efa\u7528\u6237\u7ec4<\/h3>\n<p><span class=\"token function\">groupadd<\/span> system      <span class=\"token comment\">#\u521b\u5efa\u884c\u653f\u7ba1\u7406\u90e8\u7ec4<\/span><br \/>\n<span class=\"token function\">groupadd<\/span> develop     <span class=\"token comment\">#\u521b\u5efa\u7814\u53d1\u90e8\u7ec4<\/span><br \/>\n<span class=\"token function\">groupadd<\/span> product     <span class=\"token comment\">#\u521b\u5efa\u4ea7\u54c1\u90e8\u7ec4<\/span><br \/>\n<span class=\"token function\">groupadd<\/span> <span class=\"token builtin class-name\">test<\/span>        <span class=\"token comment\">#\u521b\u5efa\u6d4b\u8bd5\u90e8\u7ec4<\/span><br \/>\n<span class=\"token function\">groupadd<\/span> sales       <span class=\"token comment\">#\u521b\u5efa\u9500\u552e\u90e8\u7ec4<\/span><\/p>\n<h3>(\u56db&#xff09;\u521b\u5efa\u7528\u6237\u5e76\u5212\u5c06\u7528\u6237\u6dfb\u52a0\u5230\u7ec4<\/h3>\n<p><span class=\"token function\">useradd<\/span> -g system -s \/sbin\/nologin  system01     <span class=\"token comment\">#-g \u6dfb\u52a0\u5230\u7ec4 (\u4e3b\u7ec4&#xff09;&#xff0c;\u5982\u679c\u4f7f\u7528 -&#xff27;\u6dfb\u52a0\u5230\u9644\u52a0\u7ec4<\/span><br \/>\n<span class=\"token function\">useradd<\/span> -g develop -s \/sbin\/nologin develop01    <span class=\"token comment\">#-s \/sbin\/nologin \u8bbe\u7f6e\u7528\u6237\u4e0d\u767b\u5f55\u7cfb\u7edf<\/span><br \/>\n<span class=\"token function\">useradd<\/span> -g product  -s \/sbin\/nologin  product01<br \/>\n<span class=\"token function\">useradd<\/span> -g <span class=\"token builtin class-name\">test<\/span> -s \/sbin\/nologin test01<br \/>\n<span class=\"token function\">useradd<\/span> -g sales -s \/sbin\/nologin  sales01<\/p>\n<h3>(\u4e94&#xff09;\u6dfb\u52a0\u7528\u6237\u8bbf\u95ee\u6743\u9650<\/h3>\n<h4>&#xff08;1&#xff09;\u4fee\u6539\u5404\u90e8\u95e8\u7684\u6587\u4ef6\u5f52\u5c5e\u548c\u6743\u9650<\/h4>\n<p><span class=\"token function\">chown<\/span> :system \/share\/system -R   <span class=\"token comment\">#\u5c06\/share\/system\u76ee\u5f55\u7684\u5f52\u5c5e\u6743\u5212\u7ed9system\u7ec4<\/span><br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">2770<\/span> \/share\/system -R      <span class=\"token comment\">#\u4fee\u6539\/share\/system\u76ee\u5f55\u7684\u8bbf\u95ee\u6743\u9650\u4e3a2770&#xff0c;\u8be6\u89c1\u4e0b\u6743\u9650\u8bf4\u660e<\/span><br \/>\n<span class=\"token function\">chown<\/span> :develop \/share\/develop -R  <span class=\"token comment\">#-R \u9488\u5bf9\u76ee\u5f55&#xff0c;\u9012\u5f52\u7684\u628a\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u3001\u76ee\u5f55\u5168\u90e8\u6539\u53d8\u4e3a\u76ee\u6807\u6743\u9650\u3002&#xff09;<\/span><br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">2770<\/span> \/share\/develop -R<br \/>\n<span class=\"token function\">chown<\/span> :product \/share\/product<br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">2770<\/span> \/share\/product\/ -R<br \/>\n<span class=\"token function\">chown<\/span> :test \/share\/test  -R<br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">2770<\/span> \/share\/test -R<br \/>\n<span class=\"token function\">chown<\/span> :sales \/share\/sales  -R<br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">2770<\/span> \/share\/sales -R<\/p>\n<h4>&#xff08;2&#xff09;\u4fee\u6539\u516c\u5171\u6587\u4ef6\u5939\u5c5e\u6027<\/h4>\n<p><span class=\"token function\">chmod<\/span> <span class=\"token number\">755<\/span> \/share\/ziliaoku<br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">1777<\/span> \/share\/public<br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">700<\/span> \/share\/developandtest <span class=\"token comment\">#\u56e0\u4e3a\u8be5\u76ee\u5f55\u662f\u4e24\u4e2a\u7ec4\u80fd\u8bbf\u95ee&#xff0c;\u4f7f\u7528\u6743\u9650\u65e0\u6cd5\u5b9e\u73b0<\/span><\/p>\n<h4>&#xff08;3&#xff09;\u8bbe\u7f6e\u8bbf\u95ee\u63a7\u5236\u5217\u8868<\/h4>\n<p>setfacl -m g:develop:rwx \/share\/developandtest\/  <span class=\"token comment\">#\u8bbe\u7f6edevelop\u7ec4\u5bf9\/share\/developandtest\/\u6709rwx\u6743\u9650 <\/span><br \/>\n<span class=\"token comment\"># -m, &#8211;modify&#061;acl  modify the current ACL(s) of file(s)<\/span><br \/>\nsetfacl -m g:test:rwx \/share\/developandtest\/<br \/>\n<span class=\"token comment\">#\u4e0a\u4e24\u53e5\u662f\u5206\u522b\u8bbe\u7f6edevelop\u548ctest\u7528\u6237\u7ec4\u5bf9developandtest\u76ee\u5f55\u5177\u6709rwx\u6743\u9650<\/span><br \/>\nsetfacl -R -m g:system:rwx \/share\/<br \/>\n<span class=\"token comment\"># \u8bbe\u7f6esystem\u7ec4\u5bf9\u6574\u4e2a\u5171\u4eab\u76ee\u5f55\u5177\u6709\u8bbf\u95ee\u6743\u9650 <\/span><\/p>\n<h4>(4)\u67e5\u770b\u6587\u4ef6\u5939\u7684\u6743\u9650<\/h4>\n<p>getfacl system<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost \/<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># getfacl \/share\/system<\/span><br \/>\ngetfacl: Removing leading <span class=\"token string\">&#039;\/&#039;<\/span> from absolute path names<br \/>\n<span class=\"token comment\"># file: share\/system<\/span><br \/>\n<span class=\"token comment\"># owner: system01<\/span><br \/>\n<span class=\"token comment\"># group: system<\/span><br \/>\n<span class=\"token comment\"># flags: -s-<\/span><br \/>\nuser::rwx<br \/>\ngroup::rwx<br \/>\ngroup:system:rwx<br \/>\nmask::rwx<br \/>\nother::&#8212;<br \/>\ndefault:user::rwx<br \/>\ndefault:group::rwx<br \/>\ndefault:group:system:rwx<br \/>\ndefault:mask::rwx<br \/>\ndefault:other::&#8212;<\/p>\n<h4>\u5c0f\u77e5\u8bc6 &#xff1a;\u6587\u4ef6\u5939\u6743\u9650\u8868\u793a<\/h4>\n<p> Linux\u8bbe\u7f6e\u6587\u4ef6\u76ee\u5f55\u6743\u9650&#xff0c;\u56db\u4f4d\u6570\u7684\u76ee\u5f55\u6743\u9650\u5b9a\u4e49<br \/>\nrwx&#xff08;1&#xff09;rwx&#xff08;2&#xff09;rwx&#xff08;3&#xff09;<br \/>\n1&#xff1a;\u6240\u6709\u8005 2&#xff1a;\u6240\u5c5e\u7ec4 3&#xff1a;\u5176\u4ed6\u7528\u6237<br \/>\nr&#xff1a;\u8bfb<br \/>\nw&#xff1a;\u5199<br \/>\nx&#xff1a;\u6267\u884c<br \/>\n\u76ee\u5f55&#xff1a;r&#xff08;\u53ef\u4ee5\u67e5\u770b\u76ee\u5f55\u5185\u6709\u591a\u5c11\u4e1c\u897f&#xff09;w&#xff08;\u53ef\u6dfb\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u76ee\u5f55\u5185\u4e1c\u897f\u7684\u719f\u6089&#xff09;x&#xff08;\u53ef\u6253\u5f00\u76ee\u5f55&#xff09;<br \/>\n\u6587\u4ef6&#xff1a;r&#xff08;\u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u7684\u5177\u4f53\u5185\u5bb9&#xff09;w&#xff08;\u53ef\u4ee5\u6dfb\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u6587\u4ef6\u7684\u5177\u4f53\u5185\u5bb9&#xff0c;\u4f46\u4e0d\u80fd\u5220\u9664\u6587\u4ef6\u672c\u8eab&#xff09;x&#xff08;\u53ef\u8fd0\u884c\u6587\u4ef6&#xff0c;\u4e00\u822c\u90fd\u7528\u4e8e\u53ef\u6267\u884c\u6587\u4ef6&#xff09;<br \/>\n3\u4f4d\u666e\u901a\u6743\u9650&#xff1a;rws&#xff08;1\u3001\u6240\u6709\u8005&#xff09;rws&#xff08;2\u3001\u6240\u5c5e\u7ec4&#xff09;rwt&#xff08;3\u3001\u5176\u4ed6\u7528\u6237&#xff09;<br \/>\n\u9690\u85cf\u6743\u9650&#xff1a;SUID&#xff08;4&#xff09;\u3001SGID&#xff08;2&#xff09;\u3001SBIT&#xff08;1&#xff09;<br \/>\n1&#xff1a;\u5373\u4f7f\u4e0d\u662f\u6587\u4ef6\u6240\u6709\u8005\u4e5f\u53ef\u4ee5\u6682\u65f6\u62e5\u6709\u6587\u4ef6\u6240\u6709\u8005\u7684\u6743\u5229<br \/>\n2\u3001\u5728\u62e5\u6709\u8fd9\u4e2a\u5c5e\u6027\u7684\u76ee\u5f55\u5185\u521b\u5efa\u7684\u4e1c\u897f&#xff0c;\u6240\u5c5e\u7ec4\u90fd\u5c5e\u4e8e\u8fd9\u4e2a\u76ee\u5f55\u7684\u6240\u5c5e\u7ec4&#xff0c;\u4e0e\u4e1c\u897f\u7684\u521b\u5efa\u8005\u65e0\u5173<br \/>\n3\u3001\u5728\u62e5\u6709\u8fd9\u4e2a\u5c5e\u6027\u7684\u76ee\u5f55\u5185\u521b\u5efa\u7684\u4e1c\u897f&#xff0c;\u9664\u4e86root\u548c\u521b\u5efa\u8005\u672c\u8eab&#xff0c;\u8c01\u90fd\u4e0d\u80fd\u5220\u3002<br \/>\n\u5728chmod\u65f6&#xff0c;**\u9690\u85cf\u6743\u9650**\u5199\u5728\u7b2c\u4e00\u4f4d<\/p>\n<h2>\u4e09\u3001Samba\u670d\u52a1\u5668\u7684\u914d\u7f6e<\/h2>\n<h3>(\u4e00&#xff09;\u5907\u4efdsamba\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u5728\u5bf9samba\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u4fee\u6539\u524d&#xff0c;\u8bf7\u5148\u5907\u4efd\u914d\u7f6e\u6587\u4ef6<\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> \/etc\/samba<br \/>\n<span class=\"token function\">cp<\/span> smb.conf smb.conf.back<\/p>\n<h3>&#xff08;\u4e8c&#xff09;\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u67e5\u770b\/etc\/samba\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost samba<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ll<\/span><br \/>\n\u603b\u7528\u91cf <span class=\"token number\">28<\/span><br \/>\n-rw-r&#8211;r&#8211;. <span class=\"token number\">1<\/span> root root    <span class=\"token number\">20<\/span> <span class=\"token number\">7<\/span>\u6708  <span class=\"token number\">17<\/span> <span class=\"token number\">2021<\/span> lmhosts<br \/>\n-rw-r&#8211;r&#8211;. <span class=\"token number\">1<\/span> root root   <span class=\"token number\">706<\/span> <span class=\"token number\">7<\/span>\u6708  <span class=\"token number\">17<\/span> <span class=\"token number\">2021<\/span> smb.conf<br \/>\n-rw-r&#8211;r&#8211;. <span class=\"token number\">1<\/span> root root   <span class=\"token number\">706<\/span> <span class=\"token number\">11<\/span>\u6708  <span class=\"token number\">4<\/span> 09:30 smb.conf.back<br \/>\n-rw-r&#8211;r&#8211;. <span class=\"token number\">1<\/span> root root <span class=\"token number\">11327<\/span> <span class=\"token number\">7<\/span>\u6708  <span class=\"token number\">17<\/span> <span class=\"token number\">2021<\/span> smb.conf.example<br \/>\n-rw-r&#8211;r&#8211;. <span class=\"token number\">1<\/span> root root   <span class=\"token number\">847<\/span> <span class=\"token number\">10<\/span>\u6708 <span class=\"token number\">30<\/span> <span class=\"token number\">20<\/span>:57 smb.conf.rpmsave<\/p>\n<p>\u7f16\u8f91smb.conf&#xff0c;\u5728\u914d\u7f6e\u6587\u4ef6\u6700\u540e\u52a0\u5165\u5982\u4e0b\u4ee3\u7801&#xff1a;<\/p>\n<p><span class=\"token punctuation\">[<\/span>share<span class=\"token punctuation\">]<\/span><br \/>\n   comment <span class=\"token operator\">&#061;<\/span> share<br \/>\n   path <span class=\"token operator\">&#061;<\/span> \/share<br \/>\n   public <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">yes<\/span><br \/>\n   writable <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">yes<\/span><\/p>\n<p>systemctl restart smb<\/p>\n<p>\u56e0\u4e3a\u5404\u4e2a\u6587\u4ef6\u5939\u5df2\u7ecf\u5355\u72ec\u8bbe\u7f6e\u4e86\u6743\u9650 &#xff0c;\u65e0\u9700\u5728\u914d\u7f6e\u6587\u4ef6\u518d\u6b21\u8bbe\u7f6e\u6743\u9650&#xff0c;\u53ea\u8981\u5c06\u603b\u7684\u5171\u4eab\u76ee\u5f55\u53d1\u5e03\u5171\u4eab\u5373\u53ef\u3002<\/p>\n<h4>\u9632\u706b\u5899\u8bbe\u7f6esamba\u901a\u884c<\/h4>\n<p>firewall-cmd &#8211;permanent &#8211;add-service<span class=\"token operator\">&#061;<\/span>samba<br \/>\nfirewall-cmd &#8211;reload <\/p>\n<h4>\u8bbe\u7f6eselinux (\u4ee5\u4e0b\u4e24\u4e2a\u547d\u4ee4\u884c&#xff0c;\u5728\/etc\/samba\/smb.conf.example\u6587\u4ef6\u4e2d&#xff09;<\/h4>\n<p>setsebool -P samba_enable_home_dirs on<br \/>\nchcon -t samba_share_t \/share -R<\/p>\n<h2>\u56db\u3001\u521b\u5efasamba\u8bbf\u95ee\u7528\u6237<\/h2>\n<p>\u521b\u5efa\u7684\u7528\u6237\u5fc5\u987b\u548c\u7cfb\u7edf\u521b\u5efa\u7684\u7528\u6237\u4e00\u81f4&#xff0c;\u53ef\u4ee5\u901a\u8fc7 cat \/etc\/passwd \u67e5\u770b\u73b0\u6709\u7528\u6237\u3002<\/p>\n<p>smbpasswd -a system01<br \/>\nsmbpasswd -a develop01<br \/>\nsmbpasswd -a product01<br \/>\nsmbpasswd -a test01<br \/>\nsmbpasswd -a sales01<\/p>\n<p>\u4f7f\u7528\u76f8\u540c\u7684\u65b9\u6cd5\u4e3a\u6bcf\u4e2a\u90e8\u95e8\u521b\u5efa\u4e00\u4e2a\u6d4b\u8bd5\u7684\u7528\u6237\u3002<\/p>\n<h2>\u4e94\u3001Linux\u4e2d\u4f7f\u7528samba\u5ba2\u6237\u7aef\u8bbf\u95ee<\/h2>\n<p>yum <span class=\"token function\">install<\/span> samba-client cifs-utils -y<br \/>\nsmbclient -U \u3010samba\u7528\u6237\u540d\u3011 -L \u3010samba\u670d\u52a1\u5668IP\u5730\u5740\u3011<\/p>\n<hr \/>\n<h2>\u516d\u3001windows\u5ba2\u6237\u7aef\u8bbf\u95ee<\/h2>\n<p>\u5728\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\u8f93\u5165\\\\ip\u5730\u5740 \u8bbf\u95eesamba\u670d\u52a1\u5668\u3002<\/p>\n<p>\u6ce8\u610f&#xff1a;\u5728windows\u4e2d\u767b\u5f55\u540e\u7528\u6237\u4f1a\u6682\u5b58&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4e0b\u5217\u65b9\u5f0f\u6e05\u9664\u8bb0\u5f55\u7684\u767b\u5f55\u7528\u6237\u3002 \u65b9\u6cd51\u3001\u5f00\u59cb -&gt; \u8fd0\u884c -&gt; cmd&#xff0c;\u6267\u884cnet use * \/del&#xff0c;\u7136\u540e\u6839\u636e\u63d0\u793a\u6309Y\u662f\u53d6\u6d88\u8fdc\u7a0b\u8fde\u63a5&#xff0c;N\u662f\u653e\u5f03\u3002\u6267\u884cnet use \u53ef\u4ee5\u67e5\u770b\u6240\u6709\u7684\u8fdc\u7a0b\u8fde\u63a5\u3002<\/p>\n<p>\u65b9\u6cd52\u3001\u5f00\u59cb -&gt; \u8fd0\u884c -&gt; control userpasswords2&#xff0c;\u9ad8\u7ea7-&gt;\u7ba1\u7406\u5bc6\u7801-&gt;windows\u51ed\u636e&#xff0c;\u7136\u540e\u628a\u4f60\u8bb0\u4f4f\u5bc6\u7801\u7684\u6240\u5728\u670d\u52a1\u5668\u540d\u79f0\u5220\u9664<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4eca\u5929\u8981\u8bb2\u7684\u5185\u5bb9&#xff0c;\u672c\u6587\u4ec5\u4ec5\u7b80\u5355\u4ecb\u7ecd\u4e86samba\u670d\u52a1\u5668\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u5728\u914d\u7f6e\u8fc7\u7a0b\u4e2d\u4e86\u89e3\u4e86\u6587\u4ef6\u5939\u6743\u9650\u7684\u8bbe\u7f6e&#xff0c;\u6587\u4ef6\u5939\u5f52\u5c5e\u8005\u7684\u66f4\u53d8&#xff0c;\u8bbf\u95ee\u63a7\u5236\u5217\u8868\u7684\u8bbe\u7f6e\u7b49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.2k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4f8b\u5982\uff1a\u4ee5\u4e0a\u5c31\u662f\u4eca\u5929\u8981\u8bb2\u7684\u5185\u5bb9\uff0c\u672c\u6587\u4ec5\u4ec5\u7b80\u5355\u4ecb\u7ecd\u4e86samba\u670d\u52a1\u5668\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u5728\u914d\u7f6e\u8fc7\u7a0b\u8fd8\u4e86\u89e3\u4e86\u6587\u4ef6\u5939\u6743\u9650\u7684\u5206\u672c\uff0c\u5f52\u5c5e\u8005\u7684\u66f4\u53d8\uff0c\u8bbf\u95ee\u63a7\u5236 \u5217\u8868\u7684\u8bbe\u7f6e\u7b49\u3002_\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668<\/p>\n","protected":false},"author":2,"featured_media":15873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[43,44],"topic":[],"class_list":["post-15874","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/15874.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.2k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4f8b\u5982\uff1a\u4ee5\u4e0a\u5c31\u662f\u4eca\u5929\u8981\u8bb2\u7684\u5185\u5bb9\uff0c\u672c\u6587\u4ec5\u4ec5\u7b80\u5355\u4ecb\u7ecd\u4e86samba\u670d\u52a1\u5668\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u5728\u914d\u7f6e\u8fc7\u7a0b\u8fd8\u4e86\u89e3\u4e86\u6587\u4ef6\u5939\u6743\u9650\u7684\u5206\u672c\uff0c\u5f52\u5c5e\u8005\u7684\u66f4\u53d8\uff0c\u8bbf\u95ee\u63a7\u5236 \u5217\u8868\u7684\u8bbe\u7f6e\u7b49\u3002_\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/15874.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T14:22:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418142240-680260308d4d6.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/15874.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/15874.html\",\"name\":\"\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T14:22:41+00:00\",\"dateModified\":\"2025-04-18T14:22:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/15874.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/15874.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/15874.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/15874.html","og_locale":"zh_CN","og_type":"article","og_title":"\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.2k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4f8b\u5982\uff1a\u4ee5\u4e0a\u5c31\u662f\u4eca\u5929\u8981\u8bb2\u7684\u5185\u5bb9\uff0c\u672c\u6587\u4ec5\u4ec5\u7b80\u5355\u4ecb\u7ecd\u4e86samba\u670d\u52a1\u5668\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u5728\u914d\u7f6e\u8fc7\u7a0b\u8fd8\u4e86\u89e3\u4e86\u6587\u4ef6\u5939\u6743\u9650\u7684\u5206\u672c\uff0c\u5f52\u5c5e\u8005\u7684\u66f4\u53d8\uff0c\u8bbf\u95ee\u63a7\u5236 \u5217\u8868\u7684\u8bbe\u7f6e\u7b49\u3002_\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/15874.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T14:22:41+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418142240-680260308d4d6.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/15874.html","url":"https:\/\/www.wsisp.com\/helps\/15874.html","name":"\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T14:22:41+00:00","dateModified":"2025-04-18T14:22:41+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/15874.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/15874.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/15874.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u914d\u7f6e\u4e0e\u7ba1\u7406samba\u670d\u52a1\u5668(\u5b9e\u8df5\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/15874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=15874"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/15874\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/15873"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=15874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=15874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=15874"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=15874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}