{"id":13547,"date":"2019-05-07T12:51:03","date_gmt":"2019-05-07T03:51:03","guid":{"rendered":"https:\/\/ekbt.net\/blog\/?p=13547"},"modified":"2019-05-07T12:51:03","modified_gmt":"2019-05-07T03:51:03","slug":"centos7-samba","status":"publish","type":"post","link":"https:\/\/ekbt.info\/?p=13547","title":{"rendered":"centos7-samba-1"},"content":{"rendered":"<p>CentOS7\u306bsamba\u3092\u5165\u308c\u3066\u3001NAS\u6a5f\u80fd\u3092\u6301\u305f\u305b\u308b\u3002<br \/>\n\u307e\u305a\u306f\u3001samba\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002CentOS7\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u300c \u30bd\u30d5\u30c8\u30a6\u30a8\u30a2\u306e\u9078\u629e \u300d\u304b\u3089 \u300c\u30b5\u30fc\u30d0\u30fc\uff08GUI\u4f7f\u7528\uff09\u300d\u3092\u30af\u30ea\u30c3\u30af\u3001\u305d\u3057\u3066\u300c\u9078\u629e\u3057\u305f\u74b0\u5883\u306e\u30a2\u30c9\u30aa\u30f3\u300d\u3067\u306f\u3001\u300c\u30d5\u30a1\u30a4\u30eb\u3068\u30b9\u30c8\u30ec\u30fc\u30b8\u30b5\u30fc\u30d0\u30fc\u300d \u3092\u9078\u629e\u3057\u3066\u3044\u308c\u3070\u3001\u81ea\u52d5\u7684\u306b\u5165\u3063\u3066\u3044\u308b\u306f\u305a\u3060\u304c\u3001\u3053\u308c\u3092\u30c1\u30a7\u30c3\u30af\u3092\u517c\u306d\u3066\u3002<\/p>\n<p>[root@centos7 ~]# yum install samba<br \/>\n\u8aad\u307f\u8fbc\u3093\u3060\u30d7\u30e9\u30b0\u30a4\u30f3:fastestmirror, langpacks<br \/>\nLoading mirror speeds from cached hostfile<\/p>\n<p>\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\u3000\u4e2d\u7565\u3000\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d<\/p>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8 samba-4.8.3-4.el7.x86_64 \u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u304b\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059<br \/>\n\u4f55\u3082\u3057\u307e\u305b\u3093<\/p>\n<p>\u3061\u3083\u3093\u3068\u306f\u3044\u3063\u3066\u3044\u308b\u3088\u3046\u3060\u3002\u5165\u3063\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u3053\u3053\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u306f\u305a\u3002<br \/>\n\u6b21\u306b\u3001samba\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3002 HDD\u306e\u9818\u57df\u304c\u4e00\u756a\u3042\u308b\/home\u306b\u4f5c\u6210\u3002<\/p>\n<p>[root@centos7 ~]# mkdir\u3000\uff0fhome\uff0fsamba<br \/>\n[root@centos7 ~]# chmod 777\u3000\uff0fhome\uff0fsamba<\/p>\n<p>\u6b21\u306b\u3001samba\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u3044\u3058\u308b\u3002<\/p>\n<p>[root@centos7 ~]# nano\u3000\uff0fetc\uff0fsamba\uff0fsmb.conf<\/p>\n<p>\u30a8\u30c7\u30a3\u30bf\u30fc\u306f\u6700\u8fd1nano\u3092\u4f7f\u3044\u3060\u3057\u305f\u304c\u3001\u3082\u3061\u308d\u3093vi\u3067\u3082OK\u3002<br \/>\n\u307e\u305a\u306f\u3001[global]\u30bb\u30af\u30b7\u30e7\u30f3\u3002<\/p>\n<p>workgroup\u306e\u8a2d\u5b9a\uff08XXXX\uff09\u306fLAN\u74b0\u5883\u306b\u5fdc\u3058\u3066\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\nnetbios name = CENTOS7\u3000\u3053\u308c\u3082\u81ea\u7531\u306b\u8a2d\u5b9a\u53ef<br \/>\n192.168.11.\u306eLAN\u5185\u304b\u3089\u306e\u307f\u30a2\u30af\u30bb\u30b9ok\u306b\u3002<br \/>\n\u30d7\u30ea\u30f3\u30bf\u306f\u4f7f\u308f\u306a\u3044\u306e\u3067\u3001\u6b62\u3081\u3066\u304a\u304f\u3002<br \/>\n[global]<br \/>\nworkgroup = EKBT<br \/>\nserver string = CentOS7 smb %v<br \/>\nsecurity = user<br \/>\nnetbios name = CENTOS7<br \/>\nhost allow = 192.168.11.<\/p>\n<p>passdb backend = tdbsam<br \/>\ndos charset = cp932<\/p>\n<p># printing = cups<br \/>\n# printcap name = cups<br \/>\nload printers = no<br \/>\ndisable spooles = yes<br \/>\n# cups options = raw<\/p>\n<p>\u6b21\u306b\u3001[Publoc]\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3002<\/p>\n<p>[Public]<br \/>\ncomment = Nas Public<br \/>\npath =\u3000\uff0fhome\uff0fsamba<br \/>\npublic = yes<br \/>\nwritable = yes<br \/>\nguest ok = yes<br \/>\nguest only = yes<\/p>\n<p>\u3053\u308c\u3067\u8a2d\u5b9a\u306f\u304a\u308f\u308a\u3002\u4e00\u5fdc\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304a\u304f\u3002<\/p>\n<p>[root@centos7 ~]# testparm<\/p>\n<p>\u554f\u984c\u306a\u3055\u305d\u3046\u3060\u3063\u305f\u3089\u3001\u7d9a\u3044\u3066\u3001samba\u7528\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u308b\u3002\u30e6\u30fc\u30b6\u30fc\u306fCentOS7\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u4f5c\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u7528\u3002<br \/>\n\u307e\u305f\u5225\u306b\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u3063\u3066\u305d\u308c\u3092\u4f7f\u3063\u3066\u3082\u3044\u3044\u3002<\/p>\n<p>[root@centos7 ~]# pdbedit -a user1<\/p>\n<p>\u3042\u3068\u306fSELinux\u304c\u3046\u3054\u3044\u3066\u3044\u308b\u306f\u305a\u306a\u306e\u3067\u3001\u3053\u308c\u3092\u6b62\u3081\u308b\u3002<br \/>\n\u307e\u305a\u306f\u52d5\u4f5c\u72b6\u6cc1\u3092\u78ba\u8a8d\u3002<\/p>\n<p>[root@centos7 ~]# getenforce<br \/>\nEnforcing<\/p>\n<p>\u52d5\u3044\u3066\u3044\u308b\u3088\u3046\u3060\u3002<br \/>\n\u4e00\u5fdc\u52d5\u4f5c\u3092\u6b62\u3081\u3066\u3001\u8b66\u544a\u306e\u307f\u306b\u3059\u308b\u3002<\/p>\n<p>[root@centos7 ~]# setenforce 0<br \/>\n[root@centos7 ~]# getenforce<br \/>\nPermissive<\/p>\n<p>LAN\u5185\u306e\u307f\u306eNAS\u904b\u7528\u306e\u5834\u5408\u306f\u3001\u5b8c\u5168\u306b\u6b62\u3081\u3066\u3082\u3044\u3044\u3068\u601d\u308f\u308c\u308b\u3002<br \/>\n\u305d\u306e\u305f\u3081\u306b\u306f\u3001SELinux\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u3044\u3058\u308b\u3002<\/p>\n<p>[root@centos7 ~]# nano\u3000\uff0fetc\uff0fsysconfig\uff0fselinux<\/p>\n<p>SELINUX=disabled\u3068\u5165\u529b\u3057SELinux\u3092\u6b62\u3081\u308b\u3002<\/p>\n<p># This file controls the state of SELinux on the system.<br \/>\n# SELINUX= can take one of these three values:<br \/>\n# enforcing &#8211; SELinux security policy is enforced.<br \/>\n# permissive &#8211; SELinux prints warnings instead of enforcing.<br \/>\n# disabled &#8211; No SELinux policy is loaded.<br \/>\n#SELINUX=enforcing<br \/>\nSELINUX=disabled<br \/>\n# SELINUXTYPE= can take one of three values:<br \/>\n# targeted &#8211; Targeted processes are protected,<br \/>\n# minimum &#8211; Modification of targeted policy. Only selected processes are pr$<br \/>\n# mls &#8211; Multi Level Security protection.<br \/>\nSELINUXTYPE=targeted<\/p>\n<p>\u3053\u308c\u3067samba\u306e\u52d5\u4f5c\u306e\u4e0b\u6e96\u5099\u306f\u7d42\u4e86\u3002samba\u3092\u8d77\u52d5\u3059\u308b\u3002<\/p>\n<p>[root@centos7 ~]# systemctl start smb<br \/>\n[root@centos7 ~]# systemctl start nmb<\/p>\n<p>samba\u306f\u8d77\u52d5\u30b9\u30c6\u30c3\u30d7\u304c\u4e8c\u3064\u3042\u308b\u306e\u3067\u4e21\u65b9\u3068\u3082\u8d77\u52d5\u3059\u308b\u3002<br \/>\n\u3055\u3089\u306b\u3001NAS\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u3067\u8d77\u52d5\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3002<\/p>\n<p>[root@centos7 ~]# systemctl enable smb<br \/>\n[root@centos7 ~]# systemctl enable nmb<\/p>\n<p>\u3053\u308c\u3067\u3001LAN\u5185\u304b\u3089\u898b\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u306a\u306e\u3067\u3001LAN\u5185\u306eWindows\u30de\u30b7\u30f3\u306b\u79fb\u52d5\u3057\u3066\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u898b\u3066\u307f\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS7\u306bsamba\u3092\u5165\u308c\u3066\u3001NAS\u6a5f\u80fd\u3092\u6301\u305f\u305b\u308b\u3002 \u307e\u305a\u306f\u3001samba\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002CentOS7\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u300c \u30bd\u30d5\u30c8\u30a6\u30a8\u30a2\u306e\u9078\u629e \u300d\u304b\u3089 \u300c\u30b5\u30fc\u30d0\u30fc\uff08GUI\u4f7f\u7528\uff09\u300d\u3092\u30af\u30ea\u30c3\u30af\u3001\u305d\u3057\u3066\u300c\u9078\u629e\u3057\u305f\u74b0\u5883\u306e\u30a2\u30c9 &hellip; <a href=\"https:\/\/ekbt.info\/?p=13547\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;centos7-samba-1&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":14194,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[139],"tags":[488,98,151,412],"class_list":["post-13547","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-centos7","tag-linux","tag-nas","tag-samba"],"_links":{"self":[{"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/posts\/13547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13547"}],"version-history":[{"count":0,"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/posts\/13547\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/ekbt.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}