{"id":655,"date":"2020-05-19T09:58:13","date_gmt":"2020-05-19T09:58:13","guid":{"rendered":"https:\/\/nmbm.biz\/sitio\/?p=655"},"modified":"2020-05-19T09:58:14","modified_gmt":"2020-05-19T09:58:14","slug":"juntar-um-sistema-cent0s-a-um-dominio-active-directory","status":"publish","type":"post","link":"https:\/\/blog.webgescom.pt\/blog\/juntar-um-sistema-cent0s-a-um-dominio-active-directory\/","title":{"rendered":"Juntar um Sistema Cent0S a um dom\u00ednio Active Directory"},"content":{"rendered":"\n<p>No seguimento do artigo <a rel=\"noreferrer noopener\" href=\"https:\/\/nmbm.biz\/sitio\/configuracao-de-dominio-active-directory-com-o-ubuntu\" target=\"_blank\">Configura\u00e7\u00e3o de dom\u00ednio Active Directory com o Ubuntu<\/a>, segue-se a integra\u00e7\u00e3o do Samba, em CentOS, no dom\u00ednio Active Directory. Utilizaremos os valores do exemplo anterior.<\/p>\n\n\n\n<p>O primeiro passo \u00e9 a instala\u00e7\u00e3o do pacotes necess\u00e1rios:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yum -y install samba-winbind samba-winbind-clients pam_krb5 krb5-workstation mdadm samba samba-client realmd<\/pre>\n\n\n\n<p>Uma vez conclu\u00edda a instala\u00e7\u00e3o, vamos adicionar a nossa m\u00e1quina CentOS ao dom\u00ednio (no nosso caso, exemplo.com):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">realm join --user=administrator --client-software=winbind exemplo.com<\/pre>\n\n\n\n<p>Inicie o servi\u00e7o winbind e garanta que inicia automaticamente:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl start winbind \nsystemctl enable winbind<\/pre>\n\n\n\n<p>Vamo-mo-nos certificar que conseguimos listar os utilizadores e os grupos do dom\u00ednio:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wbinfo -u \nwbinfo -g<\/pre>\n\n\n\n<p>Finalmente e se tudo estiver bem, vamos modificar os parametros do Samba para poder-mos definir as nossas partilhas, autorizadas no contexto do dom\u00ednio:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">edit smb.conf\n\n# See smb.conf.example for a more detailed config file or \n# read the smb.conf manpage. \n# Run 'testparm' to verify the config is correct after \n# you modified it. \n[global] \nworkgroup = EXEMPLO \nsecurity = ads \npassdb backend = tdbsam \nprinting = cups \nprintcap name = cups \nload printers = yes \ncups options = raw \nkerberos method = system keytab \ntemplate homedir = \/home\/%U@%D \ntemplate shell = \/bin\/bash \nrealm = EXEMPLO.COM \nidmap config EXEMPLO : range = 2000000-2999999 \nidmap config EXEMPLO : backend = rid \nidmap config * : range = 10000-999999 \nidmap config * : backend = tdb \nwinbind use default domain = no \nwinbind refresh tickets = yes \nwinbind offline logon = yes \nwinbind enum groups = no \nwinbind enum users = no \n\n[homes] \ncomment = Home Directories \nvalid users = %S, %D%w%S \nbrowseable = No \nread only = No \ninherit acls = Yes \n\n[printers] \ncomment = All Printers \npath = \/var\/tmp \nprintable = Yes \ncreate mask = 0600 \nbrowseable = No \n\n[print$] \ncomment = Printer Drivers \npath = \/var\/lib\/samba\/drivers \nwrite list = @printadmin root \nforce group = @printadmin \ncreate mask = 0664 \ndirectory mask = 0775 \n\n[data] \ncomment = Public Stuff \npath = \/data \nread only = No \nguest ok = Yes \nbrowseable = yes<\/pre>\n\n\n\n<p>Crie a pasta a partilhar (\/data\/):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir \/data \nchmod 777 \/data \nsystemctl restart samba<\/pre>\n\n\n\n<p>Nota: artigo escrito em portugu\u00eas, com base neste original: <a href=\"https:\/\/prolinuxhub.com\/centos-7-deploy-samba-share-with-ad-integration\/\" target=\"_blank\" rel=\"noreferrer noopener\">CentOS 7 deploy samba share with AD integration<\/a><\/p>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_655\" class=\"pvc_stats all  \" data-element-id=\"655\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>No seguimento do artigo Configura\u00e7\u00e3o de dom\u00ednio Active Directory com o Ubuntu, segue-se a integra\u00e7\u00e3o do Samba, em CentOS, no dom\u00ednio Active Directory. Utilizaremos os valores do exemplo anterior. O primeiro passo \u00e9 a instala\u00e7\u00e3o do pacotes necess\u00e1rios: yum -y install samba-winbind samba-winbind-clients pam_krb5 krb5-workstation mdadm samba samba-client realmd Uma vez conclu\u00edda a instala\u00e7\u00e3o, vamos&hellip;&nbsp;<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_655\" class=\"pvc_stats all  \" data-element-id=\"655\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[9,144],"tags":[145,51,56,149,151],"class_list":["post-655","post","type-post","status-publish","format-standard","hentry","category-linux","category-sistemas","tag-active-directory-em-linux","tag-centos","tag-samba","tag-samba-4","tag-winbind"],"aioseo_notices":[],"a3_pvc":{"activated":true,"total_views":2049,"today_views":0},"_links":{"self":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/comments?post=655"}],"version-history":[{"count":6,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/655\/revisions"}],"predecessor-version":[{"id":662,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/655\/revisions\/662"}],"wp:attachment":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/media?parent=655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/categories?post=655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/tags?post=655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}