Link to home
Start Free TrialLog in
Avatar of thomas_mathiesen
thomas_mathiesen

asked on

Samba join domain

Have a problem;

When I run smbpasswd -j DOM -r DOMPDC, I get an error, saying:
fetch_domain_sid: unable to connect to SMB server on machine frspdc. Error was : SUCCESS - 0.
Failed to get domain SID. Unable to join domain FRS.

I have already added the the machine to the PDC, and that worked fine. However, I cannot access the shares using domain usernames.

Tried to find the .mac file, but it's not there (runnin redhat 7.3).. so I thought I should rejoin.

Anyone?
Avatar of thomas_mathiesen
thomas_mathiesen

ASKER

samba_pc can ping dompdc and dompdc can ping samba_pc (using netbios names). Using lmhosts.
Try to add -U <administrator> when you try to join. Also check that the machine hasn't been allready added to the domain since adding it twice will get you an error.
In order to be able to access the samba server you have to have also a mapping beetwen the NT users and the linux users, since the rights check is done by the linux machine according to linux rules. See smbpasswd(5) man page.
You can also use the winbind daemon in order not to have linux users, but that's a little bit more complex.
Oki. Let's say that samba_pc is already added to the domain.  I added the user tmathies with "smbpasswd -a tmathies" command.. and gave it a different password than the one in the domain.

When I try to enter the share, I use the user "tmathies" (not "DOM\tmathies") and the password that I have in the domain. Doesn't work.

Does it first check the smbpasswd file? I thought it would ignore that way of authentication.

No, IT WILL CHECK the smbpasswd in order to get the uid for tmathies. So you need to have a linux user tmathies and a user in smbpasswd tmathis with the same uid as the linux one.
But this should be Ok since smbpasswd -a worked. Check also that the user isn't disabled.
Oh, don't assume that the machine is in the domain. Make sure it's in the domain or it won't work.
ok. In server manager the samba_pc is in the list of machines in the domain.

Note: the user "tmathies" has a different password in the smbpasswd than in the domain. Thought that would f@# up the authentication.

I try to enter \\samba_pc\tmathies

tmathies and domain password -> does not work
tmathies and local (smbpasswd) password -> works

?
Maybe there's something wrong with smb.conf:
workgroup = your domain
security = domain
password server = your PDC
encrypted passwords= true (or maybe false, I don't remember exactly, but it matters)
FYI: it looks like the machine is in the domain, 'cause it's listed in server manager.
Think we've got a better clue here:
last line in /var/log/samba/dttmathies01.log:
 Domain password server not available.

I can ping dompdc and in smb.conf dompdc is the one in password server.

Can't samba use a netbios name? Do i have to enter dompdc.dom.com?

/T
Tried again, and latest from /var/log/samba/machinename.log:

[2002/10/28 13:49:26, 0] smbd/password.c:connect_to_domain_password_server(1259)
  connect_to_domain_password_server: unable to connect to SMB server on machine DOMPDC. Error was : SUCCESS -
0.
[2002/10/28 13:49:26, 0] smbd/password.c:domain_client_validate(1554)
  domain_client_validate: Domain password server not available.
Have a look at previous messages. Does it say anything about a TRUST_ACCOUNT ?
The log file does not say anything about a TRUST_ACCOUNT. In what log file would that be?

This is the full log:
[2002/10/28 13:41:40, 0] smbd/password.c:connect_to_domain_password_server(1259)
  connect_to_domain_password_server: unable to connect to SMB server on machine FRSPDC. Error was : SUCCESS -
0.
[2002/10/28 13:41:40, 0] smbd/password.c:domain_client_validate(1554)
  domain_client_validate: Domain password server not available.
[2002/10/28 13:41:46, 0] smbd/password.c:connect_to_domain_password_server(1259)
  connect_to_domain_password_server: unable to connect to SMB server on machine FRSPDC. Error was : SUCCESS -
0.
[2002/10/28 13:41:46, 0] smbd/password.c:domain_client_validate(1554)
  domain_client_validate: Domain password server not available.
[2002/10/28 13:47:27, 0] rpc_client/cli_netlogon.c:cli_net_req_chal(246)
  cli_net_req_chal: Error NT_STATUS_INVALID_COMPUTER_NAME
[2002/10/28 13:47:27, 0] rpc_client/cli_login.c:cli_nt_setup_creds(48)
  cli_nt_setup_creds: request challenge failed
[2002/10/28 13:47:27, 0] smbd/password.c:connect_to_domain_password_server(1335)
  connect_to_domain_password_server: unable to setup the PDC credentials to machine FRSPDC.BRU.S1.COM. Error w
as : NT_STATUS_OK.
[2002/10/28 13:47:28, 0] smbd/password.c:domain_client_validate(1554)
  domain_client_validate: Domain password server not available.
[2002/10/28 13:47:29, 0] rpc_client/cli_netlogon.c:cli_net_req_chal(246)
  cli_net_req_chal: Error NT_STATUS_INVALID_COMPUTER_NAME
[2002/10/28 13:47:29, 0] rpc_client/cli_login.c:cli_nt_setup_creds(48)
  cli_nt_setup_creds: request challenge failed
[2002/10/28 13:47:29, 0] smbd/password.c:connect_to_domain_password_server(1335)
  connect_to_domain_password_server: unable to setup the PDC credentials to machine FRSPDC.BRU.S1.COM. Error w
as : NT_STATUS_OK.
[2002/10/28 13:47:29, 0] smbd/password.c:domain_client_validate(1554)
  domain_client_validate: Domain password server not available.
[2002/10/28 13:49:20, 0] smbd/password.c:connect_to_domain_password_server(1259)
  connect_to_domain_password_server: unable to connect to SMB server on machine FRSPDC. Error was : SUCCESS -
0.
[2002/10/28 13:49:20, 0] smbd/password.c:domain_client_validate(1554)
  domain_client_validate: Domain password server not available.
[2002/10/28 13:49:26, 0] smbd/password.c:connect_to_domain_password_server(1259)
  connect_to_domain_password_server: unable to connect to SMB server on machine FRSPDC. Error was : SUCCESS -
0.
[2002/10/28 13:49:26, 0] smbd/password.c:domain_client_validate(1554)
  domain_client_validate: Domain password server not available.


Sorry about not changing any names here, but too much of a hazzle. Seems to be a problem between the pdc and the samba server. Should I just delete the machine account in the domain and then add my samba server again?
Yep.

I had this error before and it took me a looong time before I figured it out then

The command should be:
smbpasswd -j DOM -r FRSPDC -U Admin...
USE THE NETBIOS NAME for PDC not the FQDN or you'll get back here.
You used the full domain name when you registered the machine before, haven't you ?
Hmmm.. doesnt look too good either:

[root@machine samba]# smbpasswd -j MyDom -r frspdc -U username%password
Unknown parameter encountered: "ldap ssl"
Ignoring unknown parameter "ldap ssl"
Error connecting to frspdc

Try a testparm. The error message has something to do with smb.conf.
BTW are you using ldap or ssl anywhere in you configuration ?
Stupid question; how to I do a testparam?

Turned off the ldap ssl (pretty far down in the smb.conf).. restarted smbd, but still get the "ignoring unknow..blabla".
Sorry it's testparm. It's just an utility that checks you smb.conf file
Hope ee has alot of diskspace, cause here's my file:

# Global parameters
[global]
        coding system =
        client code page = 850
        code page directory = /usr/share/samba/codepages
        workgroup = FRS
        netbios name =
        netbios aliases =
        netbios scope =
        server string = NLFS01
        interfaces =
        bind interfaces only = No
        security = DOMAIN
        encrypt passwords = Yes
        update encrypted = No
        allow trusted domains = Yes
        hosts equiv =
        min passwd length = 5
        map to guest = Never
        null passwords = No
        obey pam restrictions = Yes
        password server = frspdc
        smb passwd file = /etc/samba/smbpasswd
        root directory =
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
        passwd chat debug = No
        username map =
        password level = 0
        username level = 0
        unix password sync = Yes
        restrict anonymous = No
        lanman auth = Yes
        use rhosts = No
        log level = 2
        syslog = 1
        syslog only = No
        log file = /var/log/samba/%m.log
        max log size = 0
        timestamp logs = Yes
        debug hires timestamp = No
        debug pid = No
        debug uid = No
        protocol = NT1
        large readwrite = No
        max protocol = NT1
        min protocol = CORE
        read bmpx = No
        read raw = Yes
        write raw = Yes
        nt smb support = Yes
        nt pipe support = Yes
        announce version = 4.5
        announce as = NT
        max mux = 50
        max xmit = 65535
        name resolve order = lmhosts host wins bcast
        max packet = 65535
        max ttl = 259200
        max wins ttl = 518400
        min wins ttl = 21600
        time server = No
        unix extensions = No
        change notify timeout = 60
        deadtime = 0
        getwd cache = Yes
        keepalive = 300
        lpq cache time = 10
        max smbd processes = 0
        max disk size = 0
        max open files = 10000
        read size = 16384
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        stat cache size = 50
        use mmap = Yes
        total print jobs = 0
        load printers = Yes
        printcap name = /etc/printcap
        disable spoolss = No
        enumports command =
        addprinter command =
        deleteprinter command =
        show add printer wizard = Yes
        os2 driver map =
        strip dot = No
        character set =
        mangled stack = 50
        stat cache = Yes
        domain admin group =
        domain guest group =
        machine password timeout = 604800
        add user script =
        delete user script =
        logon script =
        logon path = \\%N\%U\profile
        logon drive =
        logon home = \\%N\%U
        domain logons = No
        os level = 0
        lm announce = Auto
        lm interval = 60
        preferred master = False
        local master = Yes
        domain master = False
        browse list = Yes
        enhanced browsing = Yes
        dns proxy = No
        wins proxy = No
        wins server =
        wins support = Yes
        wins hook =
        kernel oplocks = Yes
        oplock break wait time = 0
        add share command =
        change share command =
        delete share command =
        config file =
        preload =
        lock dir = /var/cache/samba
        utmp directory =
        wtmp directory =
        utmp = No
        default service =
        message command =
        dfree command =
        valid chars =
        remote announce =
        remote browse sync =
        socket address = 0.0.0.0
        homedir map = auto.home
        time offset = 0
        NIS homedir = No
        source environment =
        panic action =
        hide local users = No
        host msdfs = No
        winbind uid =
        winbind gid =
        template homedir = /home/%D/%U
        template shell = /bin/false
        winbind separator = \
        winbind cache time = 15
        winbind enum users = Yes
        winbind enum groups = Yes
        comment =
        path =
        alternate permissions = No
        username =
        guest account = nobody
        invalid users =
        valid users =
        admin users =
        read list =
        write list =
        printer admin =
        force user =
        force group =
        read only = Yes
        create mask = 0744
        force create mode = 00
        security mask = 0777
        force security mode = 00
        directory mask = 0755
        force directory mode = 00
        directory security mask = 0777
        force directory security mode = 00
        inherit permissions = No
        guest only = No
        guest ok = No
        only user = No
        hosts allow =
        hosts deny =
        status = Yes
        nt acl support = Yes
        max connections = 0
        min print space = 0
        strict allocate = No
        strict sync = No
        sync always = No
        write cache size = 0
        max print jobs = 1000
        printable = No
        postscript = No
        printing = lprng
        print command = lpr -r -P%p %s
        lpq command = lpq -P%p
        lprm command = lprm -P%p %j
        lppause command =
        lpresume command =
        queuepause command =
        queueresume command =
        printer name =
        use client driver = No
        default devmode = No
        printer driver =
        printer driver file = /etc/samba/printers.def
        printer driver location =
        default case = lower
        case sensitive = No
        preserve case = Yes
        short preserve case = Yes
        mangle case = No
        mangling char = ~
        hide dot files = Yes
        hide unreadable = No
        delete veto files = No
        veto files =
        hide files =
        veto oplock files =
        map system = No
        map hidden = No
        map archive = Yes
        mangled names = Yes
        mangled map =
        browseable = Yes
        blocking locks = Yes
        fake oplocks = No
        locking = Yes
        oplocks = Yes
        level2 oplocks = Yes
        oplock contention limit = 2
        posix locking = Yes
        strict locking = No
        share modes = Yes
        copy =
        include =
        exec =
        preexec close = No
        postexec =
        root preexec =
        root preexec close = No
        root postexec =
        available = Yes
        volume =
        fstype = NTFS
        set directory = No
        wide links = Yes
        follow symlinks = Yes
        dont descend =
        magic script =
        magic output =
        delete readonly = No
        dos filemode = No
        dos filetimes = No
        dos filetime resolution = No
        fake directory create times = No
        vfs object =
        vfs options =
        msdfs root = No

[public]
        comment = Public stuff
        path = /tmp
        read only = No
        guest ok = Yes

[homes]
        comment = Home Directories
        valid users = %S
        read only = No
        create mask = 0664
        directory mask = 0775

[printers]
        comment = All Printers
        path = /var/spool/samba
        guest ok = Yes
        printable = Yes
        browseable = No


The ip configuration is using dhcp..
Can you see anything wrong in this file?
I'm sorry, I have an emergency since yesterday afternoon, but  this looks like a testparm output. It looks Ok at the first glance, but how's you real config file ?
It should be a lot simpler than that.
No problem mate ;)
U get 300 points for it whenever we finish. No emergency. Shall I copy the whole smb.conf file to this case?
Yes, please.
#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name
    workgroup = FRS

# server string is the equivalent of the NT Description field
    server string = NLFS01

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1. 192.168.2. 127.

# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
    printcap name = /etc/printcap
    load printers = yes

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
    printing = lprng

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
;  guest account = pcguest

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

# Put a capping on the size of the log files (in Kb).
    max log size = 0

# Security mode. Most people will want user level security. See
# security_level.txt for details.
    security = domain

# Use password server option only with security = server
# The argument list may include:
#   password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
#   password server = *
   password server = frspdc

# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.
;  password level = 8
;  username level = 8

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
    encrypt passwords = yes
    smb passwd file = /etc/samba/smbpasswd

# The following is needed to keep smbclient from spouting spurious errors
# when Samba is built with support for SSL.
;   ssl CA certFile = /usr/share/ssl/certs/ca-bundle.crt

# The following are needed to allow password changing from Windows to
# update the Linux sytsem password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
#        the encrypted SMB passwords. They allow the Unix password
#        to be kept in sync with the SMB password.
    unix password sync = yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*

# You can use PAM's password change control flag for Samba. If
# enabled, then PAM will be used for password changes when requested
# by an SMB client instead of the program listed in passwd program.
# It should be possible to enable this without changing your passwd
# chat parameter for most setups.

    pam password change = yes

# Unix users can map to different SMB User names
;  username map = /etc/samba/smbusers

# 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 = /etc/samba/smb.conf.%m

# This parameter will control whether or not Samba should obey PAM's
# account and session management directives. The default behavior is
# to use PAM for clear text authentication only and to ignore any
# account or session management. Note that Samba always ignores PAM
# for authentication in the case of encrypt passwords = yes

    obey pam restrictions = yes

# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
    socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
;   interfaces = 192.168.12.2/24 192.168.13.2/24

# Configure remote browse list synchronisation here
#  request announcement to, or browse list sync from:
#      a specific host or from / to a whole subnet (see below)
;   remote browse sync = 192.168.3.25 192.168.5.255
# Cause this host to announce itself to local subnets here
;   remote announce = 192.168.1.255 192.168.2.44

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
;   local master = no

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
;   os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
;   domain master = yes

# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
;   preferred master = yes

# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
;   domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
;   logon script = %m.bat
# run a specific logon batch file per username
;   logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
#        %L substitutes for this servers netbios name, %U is username
#        You must uncomment the [Profiles] share below
;   logon path = \\%L\Profiles\%U

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
;   wins support = yes

# 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

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one      WINS Server on the network. The default is NO.
;   wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
    dns proxy = no
    map to guest = never
    password level = 0
    null passwords = no
    os level = 0
    preferred master = no
    domain master = no
    wins support = yes
    dead time = 0
    debug level = 0
    status = yes
    ldap ssl = no

# Case Preservation can be handy - system default is _no_
# NOTE: These can be set on a per share basis
;  preserve case = no
;  short preserve case = no
# Default case is normally upper case for all DOS files
;  default case = lower
# Be very careful with case sensitivity - it can break things!
;  case sensitive = no

#======================:====== Share Definitions ==============================
[public]
comment = Public stuff
path = /tmp
public = yes
writeable = yes
printable = no

[homes]
    comment = Home Directories
    browseable = yes
    writable = yes
    valid users = %S
    create mode = 0664
    directory mode = 0775
    available = yes
    public = no
    only user = no
    preexec close = no
    root preexec close = no
# If you want users samba doesn't recognize to be mapped to a guest user
; map to guest = bad user


# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;   comment = Network Logon Service
;   path = /usr/local/samba/lib/netlogon
;   guest ok = yes
;   writable = no
;   share modes = no


# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
;    path = /usr/local/samba/profiles
;    browseable = no
;    guest ok = yes


# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = yes
# Set public = yes to allow user 'guest account' to print
    public = yes
    writable = no
    printable = yes
    available = yes
Take out the following:
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*

   pam password change = yes

   obey pam restrictions = yes

  dns proxy = no
   map to guest = never
   password level = 0
   null passwords = no
   os level = 0
   preferred master = no
   domain master = no
   wins support = yes
   dead time = 0
   debug level = 0
   status = yes
   ldap ssl = no

You can also change the password server to "*", it will try to find a PDC on its own.
Also first try to get the server registered first, since some authentication tokens are set at this point. it's useless to try anything until this is done.
Got this;
Error connecting to frspdc
Unable to join domain FRS.
Try to use nmblookup -d4 frspdc. You can use different debug level, but 4 is quite ok usually.
ASKER CERTIFIED SOLUTION
Avatar of Mihai Barbos
Mihai Barbos
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
added interface ip=172.16.16.21 bcast=172.16.17.255 nmask=255.255.254.0
bind succeeded on port 0
Socket opened.
querying frspdc on 172.16.17.255
name_query failed to find name frspdc

Looks like we've found the problem =)
However, we are using wins over dns here in the company. Should I add frspdc to local host file, or tell samba to use wins over dns? It works to ping it..
I think I need to have samba use my wins server?
Added

 wins support = no
     wins server = 129.22.4.10
     name resolve order = wins hosts lmhosts bcast

to smb.conf.
Joining domain works!
Will test the rest now =)
Works fine now!
Ok, I'm back.

I'm also glad that it works and thanks for the points.
Just for my curiosity: what the ip of frspdc ?
172.16.8.134
Aha. That would have saved some time.
Tipical browsing is done in M$ by brodcasting, and since brodcasts do not pass throgh routers, you can never find a windows machine unless you use wins or lmhosts.
Yep, I know. But since the linux config runs wins, I would think that all services also did. Anyways; guess this paq is helpful for alot of people =)

Thanks alot!

My pleasure