{"id":1292,"date":"2018-04-30T23:53:47","date_gmt":"2018-05-01T02:53:47","guid":{"rendered":"http:\/\/wordpress.jpcorp.eti.br\/?p=1292"},"modified":"2021-12-26T12:29:33","modified_gmt":"2021-12-26T15:29:33","slug":"linux-compartilhamento-simples-com-samba-no-centos7","status":"publish","type":"post","link":"https:\/\/wordpress.jpcorp.eti.br\/?p=1292","title":{"rendered":"Linux &#8211; Compartilhamento simples com Samba no CentOS7"},"content":{"rendered":"<h3>Instalando e configurando o servi\u00e7o<\/h3>\n<pre class=\"lang:sh decode:true \">[root@centos]# yum install samba samba-client samba-common\r\n[root@centos]# systemctl enable nmb smb\r\n[root@centos]# adduser jhones\r\n[root@centos]# passwd jhones\r\n[root@centos]# groupadd samba\r\n[root@centos]# usermod jhones -aG samba\r\n[root@centos]# chmod 0770 \/storage\/\r\n[root@centos]# chown root.samba \/storage\/\r\n[root@centos]# vim \/etc\/samba\/smb.conf\r\n\r\n# See smb.conf.example for a more detailed config file or\r\n# read the smb.conf manpage.\r\n# Run 'testparm' to verify the config is correct after\r\n# you modified it.\r\n\r\n[global]\r\n        workgroup = SAMBA\r\n        security = user\r\n        passdb backend = tdbsam\r\n        map to guest = bad user\r\n        printing = cups\r\n        printcap name = cups\r\n        load printers = yes\r\n        cups options = raw\r\n\r\n#[homes]\r\n#        comment = Home Directories\r\n#        valid users = %S, %D%w%S\r\n#        browseable = No\r\n#        read only = No\r\n#        inherit acls = Yes\r\n\r\n#[print$]\r\n#        comment = Printer Drivers\r\n#        path = \/var\/lib\/samba\/drivers\r\n#        write list = root\r\n#        create mask = 0664\r\n#        directory mask = 0775\r\n\r\n[opt]\r\n        path = \/opt\r\n        valid users = root\r\n        guest ok = no\r\n        writable = yes\r\n        browsable = yes\r\n        create mask = 666\r\n        directory mask = 777\r\n        force directory mode = 0777\r\n        force create mode = 0777\r\n\r\n[storage]\r\n        path = \/storage\r\n        valid users = @samba\r\n        guest ok = no\r\n        writable = yes\r\n        browsable = yes\r\n        create mask = 666\r\n        directory mask = 777\r\n        force directory mode = 0777\r\n        force create mode = 0777\r\n\r\n[root@centos]# systemctl start nmb smb\r\n[root@centos]# smbpasswd -a jhones\r\n[root@centos]# testparm<\/pre>\n<p>&nbsp;<\/p>\n<h3>Cliente no Linux MODO1<\/h3>\n<pre class=\"lang:sh decode:true\">[root@centos]# yum install cifs-utils\r\n[root@centos]# mount.cifs \/\/192.168.1.15\/storage \/mnt\/storage -o username=jhones,password=123456<\/pre>\n<p>&nbsp;<\/p>\n<h3>Cliente no Linux MODO2<\/h3>\n<pre class=\"lang:sh decode:true \">[root@centos]# vim \/etc\/.storage\r\nusername=jhones\r\npassword=123456\r\n\r\n[root@centos]# chmod 600 \/etc\/.storage\r\n[root@centos]# mount -t cifs \/\/192.168.1.15\/storage \/mnt\/storage -o credentials=\/etc\/.storage<\/pre>\n<p>&nbsp;<\/p>\n<h3>E no \/etc\/fstab<\/h3>\n<pre class=\"lang:sh decode:true\">\/\/192.168.1.15\/storage \/mnt\/storage cifs credentials=\/etc\/.storage,defaults 0 0<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Instalando e configurando o servi\u00e7o [root@centos]# yum install samba samba-client samba-common [root@centos]# systemctl enable nmb smb [root@centos]# adduser jhones [root@centos]# passwd jhones [root@centos]# groupadd samba [root@centos]# usermod jhones -aG samba [root@centos]# chmod 0770 \/storage\/ [root@centos]# chown root.samba \/storage\/ [root@centos]# vim \/etc\/samba\/smb.conf # See smb.conf.example for a more detailed config file or # read the smb.conf&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[9,54],"class_list":["post-1292","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-samba"],"_links":{"self":[{"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=\/wp\/v2\/posts\/1292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1292"}],"version-history":[{"count":3,"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=\/wp\/v2\/posts\/1292\/revisions"}],"predecessor-version":[{"id":1295,"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=\/wp\/v2\/posts\/1292\/revisions\/1295"}],"wp:attachment":[{"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.jpcorp.eti.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}