Samba 4 - Instalação e configuração

Neste artigo vou descrever um passo a passo sobre como instalar e configurar o Samba 4 como AD, utilizando o BIND 9 como DNS do domínio Samba, integrado com o Kerberos para autenticar e atualizar a base do BIND de forma automatizada.

[ Hits: 133.752 ]

Por: Joferson Sodré em 27/03/2013


Kerberos: Configuração e integração



Configurando o Kerberos

Essa parte é bem simples, devemos copiar o arquivo "krb5.conf" gerado pelo Samba e substituir pelo existente no /etc. Para isso devemos fazer uma cópia do arquivo atual para efeito de backup.

Efetue uma cópia do arquivo /etc/krb5.conf:

# cp /etc/krb5.conf /etc/krb5.conf_bkp
# cat /opt/samba4/share/setup/krb5.conf > /etc/krb5.conf


Verifique se o arquivo /etc/krb5.conf está correto:

# cat /etc/krb5.conf

Saída do comando:

[libdefaults]

   default_realm = ${REALM}

   dns_lookup_realm = false

   dns_lookup_kdc = true

Testar o Kerberos da seguinte forma:

# kinit administrator@PDC.NET

Digite a senha que cadastrou no domínio e vai aparecer a mensagem:

Warning: Your password will expire in 41 days on Fri May  3 11:59:52 2013


Agora teste efetuando o comando abaixo, se não der nenhum erro, está tudo certo:

# samba_dnsupdate --verbose --all-names

Agora é só começar a adicionar as máquinas ao domínio criado.

Página anterior    

Páginas do artigo
   1. Samba 4 / BIND DLZ
   2. smb.conf / BIND (DNS)
   3. Kerberos: Configuração e integração
Outros artigos deste autor
Nenhum artigo encontrado.
Leitura recomendada

Configuração simples Samba + LDAP

Instalando um PDC Samba no Debian

Política de segurança com o Samba

Samba 4 como controlador de domínio

Logando o Windows XP no Samba

  
Comentários
[1] Comentário enviado por mebelin em 27/03/2013 - 13:29h

Como altero a senha do administrator do samba ?

[2] Comentário enviado por joferson em 27/03/2013 - 15:04h


A troca da senha do administrator e feita da seguinte forma:

# samba-tool user setpassword administrator

[3] Comentário enviado por joferson em 27/03/2013 - 15:14h

O seguinte comentário foi enviado para você por mebelin:
-------------------------------------------------------------
P: qual diretório é instalado o samba pelo APT ?

R: Como não instalei desta forma não posso afirma onde fica.
Aconselho que use o comando whereis samba ou whereis samba4, para saber onde estão os diretório relacionado a sua instalação.
Espero que isso possa lhe ajudar.

[4] Comentário enviado por serafim.fabio em 29/03/2013 - 17:24h

Ótimo seu artigo, Joferson Sodré, parabens, estou querendo atualizar o meu samba 3.6 para o 4, alguma dica?

[5] Comentário enviado por doldan em 31/03/2013 - 15:23h

Joferson, não consegui instalar por aqui, ao rodar o comando apt-get install samba4, recebo a mensagem no terminal
"o pacote samba4 não está disponivel, mas é referenciado por outro pacote .......
...o pacote samba4 não tem candidato para instalação."
Antes disto rodei os comandos conforme no artigo.
O que esqueci?

[6] Comentário enviado por joferson em 01/04/2013 - 09:46h

Caro amigo serafim.fabio, não efetuei testes de migração ainda mais neste link vc vai encontra toda passo a passo como efetuar essa migração https://wiki.samba.org/index.php/Samba4/samba-tool/domain/classicupgrade/HOWTO. Espero que tenha te ajudado.

[7] Comentário enviado por joferson em 01/04/2013 - 09:50h

Caro Doldan,
Antes de mais nada qual distribuição do Linux vc esta usando, vc adicionou a ppa de forma correta. verifique com o comando apt-cache show samba4 para ver o pacote disponível para sua instalação.

[8] Comentário enviado por doldan em 02/04/2013 - 13:44h

Boa tarde Joferson,
utilizo o debian 6.0.7 32 bits
quanto ao ppa, com os comandos do artigo não deu certo, recebo a mensagem no terminal de comando não encontrado para o add-apt-repoistory


[9] Comentário enviado por andrecaleiros em 04/04/2013 - 11:36h

excelente artigo!!

[10] Comentário enviado por willsazon em 08/04/2013 - 10:17h


[8] Comentário enviado por doldan em 02/04/2013 - 13:44h:

Boa tarde Joferson,
utilizo o debian 6.0.7 32 bits
quanto ao ppa, com os comandos do artigo não deu certo, recebo a mensagem no terminal de comando não encontrado para o add-apt-repoistory




Alguem conseguiu instalar no ubuntu 12.04?

nao consigo instalar add-apt-repository ppa:kernevil/samba4-bundled, deu falha.


ai nao passa mais para adiante.

[11] Comentário enviado por rodrigomori em 08/04/2013 - 14:14h

Estou com o mesmo problemas ao adicionar o repositorio.

[12] Comentário enviado por andrecaleiros em 08/04/2013 - 15:05h

instalei o meu no Ubuntu 12.04.2 LTS e está indo muito bem.

@ Alguém conseguiu ver a questão do hot-backup?

[13] Comentário enviado por joferson em 08/04/2013 - 15:16h

Boa tarde!

willsazon,

Tudo aqui postado foi testa e Homologado no Ubuntu server 12.04. Logo se esta utilizando outra distribuição cabe ressalta a necessidade de algumas alterações para se adequar a sua necessidade.

Neste caso sugiro que compile o pacote na mão.


[14] Comentário enviado por joferson em 24/04/2013 - 14:51h

Bom tarde!

Gostaria de comunicar a todos que foi efetuada um atualização em meu artigo no dia 22-04-2013 deixando-o de forma a facilitar a intendimento de todos.

[15] Comentário enviado por dat lopes em 09/05/2013 - 12:27h

Alguém me da uma força?

Sou iniciante em linux então se precisar de mais informações me peçam pois não sei o que devo postar a mais aqui.

Quando dou o comando para testar o Samba:

# smbclient -L localhost -U administrator

Ele retorna:

session setup failed nt_status_connection_refused

Tentei usar o comando com o nome da máquina e com ip (estou com o DHCP do virtual box endereçando).

Alguém sabe me dizer o que pode estar acontecendo?

[16] Comentário enviado por rcastro em 19/06/2013 - 07:22h

Bom dia Amigo,

Segui seu tutorial até o fim da instalação do Bind e tive alguns problemas que caso possível gostaria de ajuda.

1 - Utilizo o Debian 7 Wheezy

2- Primeiro erro ocorreu ao utilizar o samba-tool domain provision que retornou ERROR: No such subcommand 'provision', mesmo assim prossegui a instalação e ao utilizar o comando smbclient -L localhost -U administrator retornou o erro:

Unknown parameter encountered: "server role"
Ignoring unknown parameter "server role"
Unknown parameter encountered: "server services"
Ignoring unknown parameter "server services

Enter administrator's password:
Domain=[CASTRO] OS=[Unix] Server=[Samba 3.6.6]

Sharename Type Comment
--------- ---- -------
print$ Disk Printer Drivers
sysvol Disk
netlogon Disk
IPC$ IPC IPC Service (srvcastro server)
Domain=[CASTRO] OS=[Unix] Server=[Samba 3.6.6]

Server Comment
--------- -------
SRVCASTRO srvcastro server

Workgroup Master
--------- -------
CASTRO SRVCASTRO

Como corrigir isso ? o que eu errei ? rs tentei pesquisar algo sobre porém por falta de conhecimento não consegui muita coisa.

Meu smb.conf

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = CASTRO

# server string is the equivalent of the NT Description field
server string = %h server

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
# wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
# security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
# load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
# socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
# domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
; winbind enum groups = yes
; winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes

#======================= Share Definitions =======================

realm = RCASTRO.DYNDNS.INFO
server role = active directory domain controller
server services = s3fs,rpc,nbt,wrepl,ldap,cldap,kdc,drepl,winding,ntp_signd,kcc,dnsupdate
[homes]
comment = Home Directories
browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /opt/samba4/var/locks/sysvol
; guest ok = yes
; read only = no

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

[sysvol]
path = /var/lib/samba/sysvol
read only = no

[netlogon]
path = /var/lib/samba/sysvol/RCASTRO.DYNDNS.INFO/scripts
read only = no


[17] Comentário enviado por rcastro em 19/06/2013 - 07:31h

Bom dia Amigo,

Continuando agora o problema com o Bind, segui a instalação e ao restartar o serviço retorna erro:

[....] Stopping domain name service...: bind9rndc: connect failed: 127.0.0.1#953: connection refused
. ok
[FAIL] Starting domain name service...: bind9 failed!

###############################################################################
Verificando o log:

Jun 19 07:24:44 srvcastro named[5133]: available at https://www.isc.org/support
Jun 19 07:24:44 srvcastro named[5133]: ----------------------------------------------------
Jun 19 07:24:44 srvcastro named[5133]: adjusted limit on open files from 4096 to 1048576
Jun 19 07:24:44 srvcastro named[5133]: found 2 CPUs, using 2 worker threads
Jun 19 07:24:44 srvcastro named[5133]: using up to 4096 sockets
Jun 19 07:24:44 srvcastro named[5133]: loading configuration from '/etc/bind/named.conf'
Jun 19 07:24:44 srvcastro named[5133]: /etc/bind/named.conf.options:7: missing ';' before '/'
Jun 19 07:24:44 srvcastro named[5133]: /etc/bind/named.conf.options:7: expected IP match list element near '/'
Jun 19 07:24:44 srvcastro named[5133]: loading configuration: unexpected token
Jun 19 07:24:44 srvcastro named[5133]: exiting (due to fatal error)

#################################################################################

Meu arquivo named.conf.options

options {
directory "/var/cache/bind";
tkey-gssapi-keytab "/var/lib/samba/private/dns.keytab";
allow-query-cache {
127.0.0.1;
192.168.0.0/24;
192.x.x.x/24
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113

// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.

// forwarders {
// 0.0.0.0;
// };

//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;

auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};

#################################################################################
Meu /etc/apparmor.d/usr.sbin.named:

# vim:syntax=apparmor
# Last Modified: Fri Jun 1 16:43:22 2007
#include <tunables/global>

/usr/sbin/named {
#include <abstractions/base>
#include <abstractions/nameservice>

capability net_bind_service,
capability setgid,
capability setuid,
capability sys_chroot,
capability sys_resource,

# /etc/bind should be read-only for bind
# /var/lib/bind is for dynamically updated zone (and journal) files.
# /var/cache/bind is for slave/stub data, since we're not the origin of it.
# See /usr/share/doc/bind9/README.Debian.gz
/etc/bind/** r,
/var/lib/bind/** rw,
/var/lib/bind/ rw,
/var/cache/bind/** rw,
/var/cache/bind/ rw,

# gssapi
/etc/krb5.keytab kr,
/etc/bind/krb5.keytab kr,

# ssl
/etc/ssl/openssl.cnf r,

# dnscvsutil package
/var/lib/dnscvsutil/compiled/** rw,

/proc/net/if_inet6 r,
/proc/*/net/if_inet6 r,
/usr/sbin/named mr,
/{,var/}run/named/named.pid w,
/{,var/}run/named/session.key w,
# support for resolvconf
/{,var/}run/named/named.options r,

# some people like to put logs in /var/log/named/ instead of having
# syslog do the heavy lifting.
/var/log/named/** rw,
/var/log/named/ rw,

##Alteracoes

/opt/samba4/private/** rw,

/opt/samba4/private/dns/** rw,

/opt/samba4/private/named.conf r,

/opt/samba4/private/named.conf.update r,

/opt/samba4/share/setup/named.conf.update r,

/opt/samba4/private/dns.keytab rk,

/opt/samba4/private/dns/sam.ldb/** k,

/var/tmp/* rw,

/opt/samba4/lib/* rm,

/run/named/session.key rm,

/opt/samba4/lib/** rm,

/opt/samba4/private/dns/sam.ldb k,

/opt/samba4/private/dns/sam.ldb.d/** k,



# Site-specific additions and overrides. See local/README for details.
#include <local/usr.sbin.named>
}

#####################################################################################
Meu /var/lib/samba/private/named.conf:

# This DNS configuration is for BIND 9.8.0 or later with dlz_dlopen support.
#
# This file should be included in your main BIND configuration file
#
# For example with
# include "/var/lib/samba/private/named.conf";

#
# This configures dynamically loadable zones (DLZ) from AD schema
# Uncomment only single database line, depending on your BIND version
#
dlz "AD DNS Zone" {
# For BIND 9.8.0
database "dlopen /usr/lib/i386-linux-gnu/samba//bind9/dlz_bind9.so";

# For BIND 9.9.0
# database "dlopen /usr/lib/i386-linux-gnu/samba//bind9/dlz_bind9_9.so";
};


Agradeço desde já a ajuda...




[18] Comentário enviado por cristian_20 em 23/06/2013 - 11:46h

Alguêm pode me ajudar, quando dou o comando samba start, samba stop, samba restart vem sempre essa mensagem

[2013/06/23 11:45:29, 0] ../lib/util/debug.c:592(reopen_logs_internal)
Unable to open new log file '/var/log/samba/log.%m': Permission denied
[2013/06/23 11:45:29, 0] ../source4/smbd/server.c:369(binary_smbd_main)
samba version 4.0.3 started.
Copyright Andrew Tridgell and the Samba Team 1992-2012

Alguêm sabe o que pode ser .?

[19] Comentário enviado por jgama em 12/07/2013 - 22:21h

Mestres, a instalação ia perfeito, mas quando chegou na parte do BIND aconteceu isso abaixo e não estou conseguindo resolver.

root@cclinuxsrv:~/bind9-9.9.3.p1# dpkg-buildpackage
dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro
dpkg-buildpackage: pacote fonte bind9
dpkg-buildpackage: versão da fonte 1:9.9.3.p1-retrosnub2+rl.156.01
dpkg-buildpackage: fonte alterada por Malcolm Scott <debianpkg@malc.org.uk>
dpkg-buildpackage: arquitetura do servidor i386
dpkg-source --before-build bind9-9.9.3.p1
debian/rules clean
debian/rules:53: *** faltando o separador (você pensou em TAB ao invés de 8 espaços?). Pare.
dpkg-buildpackage: erro: debian/rules clean deu erro de saída estado 2
root@cclinuxsrv:~/bind9-9.9.3.p1# nano debian/rules
root@cclinuxsrv:~/bind9-9.9.3.p1#

Uso Ubuntu 12.04 LTS

Alguém sabe o que devo fazer?

Obrigado

[20] Comentário enviado por tjferr em 15/07/2013 - 13:28h

Não consigo instalar o Bind9.

A versão baixada:

root@ubuntu:/home/tiago# ls
bind9-9.9.3.p1 bind9_9.9.3.p1-retrosnub2+rl.156.01.diff.gz
bind9_9.9.3.p1.orig.tar.gz bind9_9.9.3.p1-retrosnub2+rl.156.01.dsc

1. Editei o arquivo bind9-9.9.3-p1/debian/rules:

configure: configure-stamp
configure-stamp:
dh_testdir
dh_autoreconf
./configure --prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--sysconfdir=/etc/bind \
--localstatedir=/var \
--enable-threads \
--enable-largefile \
--with-libtool \
--enable-shared \
--enable-static \
--with-openssl=/usr \
--with-gssapi=/usr \
--with-gnu-ld \
--with-geoip=/usr \
--with-atf=no \
--with-gssapi=/usr/include/gssapi \
--with-dlopen=yes \
--enable-ipv6 \
$(EXTRA_FEATURES)

touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
dh_testdir
LD_LIBRARY_PATH=$$(pwd)/lib/isc/.libs:$$(pwd)/lib/isccc/.libs:$$(pwd)/isccfg/.libs:$${LD_LIBRARY_PATH} $(MAKE)
touch build-stamp

2. A instalação do Samba 4.0.5 e das dependências foram todas instaladas conforme o tutorial.
3. Quando dou o comando #dpkg-buildpackage retorna o seguinte erro e os ".deb" não são gerados. Veja:

root@ubuntu:/home/tiago/bind9-9.9.3.p1/debian# cd ..
root@ubuntu:/home/tiago/bind9-9.9.3.p1# dpkg-buildpackage
dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro
dpkg-buildpackage: pacote fonte bind9
dpkg-buildpackage: versão da fonte 1:9.9.3.p1-retrosnub2+rl.156.01
dpkg-buildpackage: fonte alterada por Malcolm Scott <debianpkg@malc.org.uk>
dpkg-buildpackage: arquitetura do servidor i386
dpkg-source --before-build bind9-9.9.3.p1
dpkg-checkbuilddeps: Dependências de construção não satisfeitas: dh-autoreconf
dpkg-buildpackage: aviso: Construção de dependências/conflitos insatisfeitos; abortando
dpkg-buildpackage: aviso: (Use a flag -d para sobrescrever.)
root@ubuntu:/home/tiago/bind9-9.9.3.p1#

4. Por favor, existe alguma forma de corrigir este problema? Mandem sugestões. Agradecido



[21] Comentário enviado por jgama em 20/07/2013 - 09:45h

Caros Colegas o erro no bind também aconteceu comigo na primeira vez que tentei instalar, tem um detalhe, vai reclamar de uma depedencia do dh-autoreconf, para resolver é só instalar o pacote com apt-get install dh-autoreconf

Depois tem outro detalhe, veja que no final da copilação aparece um erro "
debian/rules clean
debian/rules:53: *** faltando o separador (você pensou em TAB ao invés de 8 espaços?). Pare.
dpkg-buildpackage: erro: debian/rules clean deu erro de saída estado 2

Isso acontece porque quando foi incluso as linhas abaixo no arquivo vim debian/rules não pode usar a barra de espaço, tem que dar enter para cliar a linha e depois usar a tecla Tab duas vezes para linha.
--with-gssapi=/usr/include/gssapi \
--with-dlopen=yes \

Ficando assim:

configure: configure-stamp
configure-stamp:
dh_testdir
dh_autoreconf
./configure --prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--sysconfdir=/etc/bind \
--localstatedir=/var \
--enable-threads \
--enable-largefile \
--with-libtool \
--enable-shared \
--enable-static \
--with-openssl=/usr \
--with-gssapi=/usr \
--with-gnu-ld \
--with-geoip=/usr \
--with-atf=no \
--enable-ipv6 \
--with-gssapi=/usr/include/gssapi \
--with-dlopen=yes \
$(EXTRA_FEATURES)

Desta forma a copilação vai executar sem errors.

Espero que ajude os demais que estão com esse problema.
Abraço

[22] Comentário enviado por jgama em 20/07/2013 - 09:55h

Agora é minha vez de pedir ajuda, no meu caso deu tudo certo com exceção na hora do teste do kinit, por exemplo:

root@srv-pdc1:/# kinit administrator@CCBSUMARE.LOCAL
kinit: Cannot contact any KDC for realm 'CCBSUMARE.LOCAL' while getting initial credentials
root@srv-pdc1:/#


Em uma outra instalação do samba 4 em uma outro Servidor o qual esta funcionando muito bem, e usei os sources do samba.4.7.0 aconteceu isso também, mas foi resolvido incluindo novos paramentros no arquivo /etc/krb5.conf por exemplo:

[libdefaults]
default_realm = CCBSUMARE.LOCAL
dns_lookup_realm = false
dns_lookup_kdc = true

[realms]
CCBSUMARE.LOCAL = {
kdc = srv-pdc1.ccbsumare.local:88
#admin_server = srv-pdc1.ccbsumare.local
default_domain = ccbsumare.local
}

[domain_realm]
.ccbsumare.local = CCBSUMARE.LOCAL
ccbsumare.local = CCBSUMARE.LOCAL


Tem fazer um teste com usando estes parametros no /etc/krb5.conf mas não deu certo também.

Alguém sabe como resolver?

Abraço


[23] Comentário enviado por jgama em 20/07/2013 - 10:08h

Olá pessoal consegui resolver o meu problema com kinit. tive que acrescentar alguma linha no /etc/krb5.conf, mas para dar certo tive que também incluir no arquivo /etc/hosts o nome do host onde esta instalado o samba 4 por exemplo;

127.0.0.1 localhost
127.0.1.1 srv-pdc1
192.168.0.1 srv-pdc1.ccbsumare.local srv-pdc1 # esta foi a linha que incluir

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


Arquivo do /etc/krb5.conf alterado

[libdefaults]
default_realm = ${REALM}
dns_lookup_realm = false
dns_lookup_kdc = true

[realms]
CCBSUMARE.LOCAL = {
kdc = srv-pdc1.ccbsumare.local:88
#admin_server = srv-pdc1.ccbsumare.local
default_domain = ccbsumare.local
}

[domain_realm]
.ccbsumare.local = CCBSUMARE.LOCAL
ccbsumare.local = CCBSUMARE.LOCAL


Bom vamos ver como vai se comporta o AD agora.

Abraço

[24] Comentário enviado por rengaf1 em 07/08/2013 - 10:53h

Pessoal..... alguem ai tem essa configuração do bind9_DLZ pra centos?

[25] Comentário enviado por backuppc em 21/08/2013 - 10:22h

Salve !

Coloquei o samba4 para funciona com windows 7 + 8 sem precisar mexer em
registro nenhum.

Coloquei para ser gerenciado pelo RSAT do windows ou seja crio , removo ,
realizo GPO tudo pelo meu desktop do windows 7.

Quero que quando criado usuário no AD, que seja feito o diretório home no
linux (ubuntu ). SERIA POSSIVEL ? Se alguém souber algo por favor me ajude.

Quando crio um usuario pelo samba4 samba-tool user add esse usuario é criado
em qual caminho ? no samba 3 era /home /etc/passwd

No samba 4 , não acontece nada disso :(

Estou meio perdido !


[26] Comentário enviado por felkotron em 18/09/2013 - 08:35h

Pra quem tem erro no bind compilando.

sudo apt-get install dh-autoconf.

noidmvp@gmail.com

[27] Comentário enviado por jaelcio em 30/10/2013 - 18:00h

o meu deu um erro na compilação do bind9, fiz a alteração no arquivo rules, mas deu um erro diferente dos que aconteceram anterior as minhas tentativas

configure.in:17: warning: prefer named diversions
configure.in:17: warning: prefer named diversions
configure.in:45: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.in:1642: error: possibly undefined macro: AM_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1
dh_autoreconf: autoreconf -f -i returned exit code 1
make: ** [configure-stamp] Erro 2
dpkg-buildpackage: erro: debian/rules build deu erro de saída estado 2

[28] Comentário enviado por xanxam26 em 14/01/2014 - 15:39h

Olá, boa tarde.

Sou novato no linux e estou adorando, mas estou com um problema.

Baixei o ubuntu server 12.04 conforme o tuto aqui, e fui seguindo os passos, e tudo foi dando certo conforme as coordenadas, porem quando uso o comando "dpkg-buildpackage" para gerar o .deb, e volto ao diretório anterior usando o "cd ..", ao usar o "dpkg -i *.deb " nada acontece, e quando olho na pasta com "ls" não existe nenhum .deb la.


Parei nesse ponto para não estragar nada. O que faço?

[29] Comentário enviado por birak em 21/02/2014 - 16:52h

o meu aparece um erro parecido com o do jgama:

administrador@ubuntu-server:/bind9-9.9.5$ sudo dpkg-buildpackage
dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro
dpkg-buildpackage: pacote fonte bind9
dpkg-buildpackage: versão da fonte 1:9.9.5-retrosnub0
dpkg-buildpackage: fonte alterada por Malcolm Scott <debianpkg@malc.org.uk>
dpkg-buildpackage: arquitetura do servidor i386
dpkg-source --before-build bind9-9.9.5
dpkg-checkbuilddeps: Dependências de construção não satisfeitas: debhelper (>= 5) libtool bison libdb-dev (>> 4.6) libxml2-dev libcap2-dev hardening-wrapper libgeoip-dev (>= 1.4.6.dfsg-5) dh-autoreconf
dpkg-buildpackage: aviso: Construção de dependências/conflitos insatisfeitos; abortando
dpkg-buildpackage: aviso: (Use a flag -d para sobrescrever.)


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts