Samba and kerberos

Been trying to get a samba server to authenticate with kerberos. But lately the authentication has failed with an error:

rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
added interface lo ip=::1 bcast= netmask=ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
added interface lo ip=127.0.0.1 bcast=127.255.255.255 netmask=255.0.0.0
added interface enp8s0.9 ip=192.168.0.26 bcast=192.168.0.255 netmask=255.255.255.0
added interface enp8s0.2 ip=192.168.200.26 bcast=192.168.207.255 netmask=255.255.248.0
Enter denzuko's password:
session setup failed: NT_STATUS_USER_SESSION_DELETED
root@PRLXFIL01:/etc# session setup failed: NT_STATUS_USER_SESSION_DELETED
session: command not found

The current config Iā€™m working with to get this as a member not domain controller is:

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

[global]

# Added by Luke
#   security = user
   security = ADS

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = DMS
   realm = DMS.LOCAL

   server string = %h server (Samba, Ubuntu)
   wins support = yes
   dns proxy = yes

#### Networking ####

   #interfaces = 127.0.0.0/8 enp8s0.9@enp8s0 enp8s0.2@enp8s0
   interfaces = lo enp8s0.9 enp8s0.2
   bind interfaces only = yes

#### Debugging/Accounting ####
   log file = /var/log/samba/log.%m
   log level = 3
   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 #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   #server role = standalone server
   server role = member server
   encrypt passwords = yes
   password server = prdc1.dms.local

# 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 <<[email protected]> 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 ###########

#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or '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

############ 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

# 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
    idmap config * : backend = ldap
    #idmap config * : range = 10000-20000
    ;idmap config *:backend = tdb
    idmap config *:range = 2000-9999
    idmap config DMS.LOCAL:backend = rid
    idmap config DMS.LOCAL:range = 10000-999999
    username map = /etc/samba/user.map


# 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 =======================

[netlogon]
   comment = Network Logon Service
   path = /tank/netlogon
   guest ok = yes
   read only = yes

[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
   available = yes

# Added by Luke
[footage]
   path = /tank/footage
   available = yes
   valid users = blueiris
   read only = no
   browseable = yes
   public = yes
   writable = yes

[timelapse]
   path = /tank/timelapse
   available = yes
   valid users = blueiris
   read only = no
   browseable = yes
   public = yes
   writable = yes

[member]
   path = /tank/members/%U
   public = yes
   writable = yes
   comment = member home
   browseable = yes
   read only = yes
   create mask = 0775
   directory mask = 0775
   valid users = %S
   guest ok = no
   available = yes
   #write list = root, @lpadmin "dms members..."


[members]
   path = /tank/members/
   public = yes
   writable = no
   comment = members drive
   browseable = yes
   read only = no
   create mask = 0775
   directory mask = 0775
   #valid users = %S
   guest ok = yes
   available = yes
   #write list = root, @lpadmin "dms members..."

[committes]
   path = /tank/commitees
   comment = committees drive
   available = yes
   read only = no
   browseable = yes
   public = yes
   writable = yes

Krb setting is:


[libdefaults]
        default_realm = DMS.LOCAL

        krb4_config = /etc/krb.conf
        krb4_realms = /etc/krb.realms
        kdc_timesync = 1
        ccache_type = 4
        forwardable = true
        proxiable = true
        dns_lookup_kdc = true
        dns_lookup_realm = true

## java
#       default_tgs_enctypes = des3-hmac-sha1
#       default_tkt_enctypes = des3-hmac-sha1
#       permitted_enctypes = des3-hmac-sha1

[realms]
        DMS.LOCAL = {
                kdc = prdc1.dms.local
                admin_server = prdc1.dms.local
                default_domain = dms.local
        }

[domain_realm]
        dms.local = DMS.LOCAL
        .dms.local = DMS.LOCAL

[login]
        krb4_convert = true
        krb4_get_tickets = false

This has been a blocker for me and Iā€™m wondering if anyone has ran into this before?

image
I know itā€™s Linux and youā€™re not supposed to need to do that, but I seem to recall that being ā€˜the trickā€™ with some versions/combinations of Ubuntu/SAMBA/Keberos ā€¦
Step 1: configure
Step 2: try to use
Step 3: configure again
Step 4: fail in using again
Step 5: stop/start services
Step 6: try to use
Step 7: curse stupid SAMBA
Step 8: reconfigure yet again
Step 9: fail in using again
Step 10: check configuration for umpteenth time
Step 11: fail in using again
Step 12: reboot ā€œeven though I shouldnā€™t have toā€
(thatā€™s why theyā€™re always 12 step programs).

2 Likes

As with any Linux projectā€¦

Google search for obvious keywords
ā€¦ and only find 4 year old ā€œsolutionsā€ that donā€™t list the steps leading up to the ā€œsolutionā€.

2 Likes

tell me about itā€¦ when it come to anything remotely ā€œEnterpriseā€ level itā€™s like one needs a doctorates in CIS and actually wrote the implementation to get answers.

and people wonder why I come off so ā€œsmarty-pantsā€ā€¦ after all someone got to figure out how something works to support it beyond just banging it with a hammer and power cycling.

password server = prdc1.dms.local

Are you certain prdc1 is reachable from the Samba computer?

By name?

dms.local vs DMS.LOCAL

ā€œShould not matterā€ is not the same ā€œdoes not matterā€. Many times I have crossed paths with a case-sensitive problem where there should be none. And, making them all uppercase / lowercase should only take a short while (after making a backup).

2 Likes