Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1218926

Summary: Samba ignores default_keytab_name in krb5.conf
Product: Red Hat Enterprise Linux 7 Reporter: Ondrej <ondrej.valousek.xm>
Component: sambaAssignee: Andreas Schneider <asn>
Status: CLOSED ERRATA QA Contact: Andrej Dzilský <adzilsky>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: adzilsky, asn, gdeschner, jarrpa, ondrej.valousek.xm, rhack, sbose
Target Milestone: rc   
Target Release: 7.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: samba-4.6.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 18:19:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ondrej 2015-05-06 08:03:14 UTC
Description of problem:
[root@rh6laptop ~]# cat /etc/krb5.conf
...
[libdefaults]
 default_keytab_name = FILE:/var/lib/samba/krb5.keytab
...

[root@rh6laptop ~]# cat /etc/samba/smb.conf 
...
    kerberos method = system keytab

When I do "net ads join", the real location of the system keytab file (var/lib/samba/krb5.keytab) is being ignored. Samba still tries to use /etc/krb5.keytab

tested with samba-common-3.6.23-14.el6_6.x86_64

Comment 4 Andrej Dzilský 2017-04-27 13:38:45 UTC
I am not able to reproduce this Bug :/ on 3.6.23-14.el6_6.x86_64, it works for me pretty good there.
Also it works on current version of Samba (4.6.0+) too.

I will appreciate any info for testing to get this bug verified.

Comment 5 Ondrej 2017-04-27 14:42:24 UTC
I can still reproduce this bug on samba-common-3.6.23-42.el6_9.x86_64 using the steps above.
Samba still ignores default_keytab_name setting in /etc/krb5.conf

Comment 7 Ondrej 2017-04-28 07:15:05 UTC
Which other info shall I provide?
The steps to reproduce are still the same - "net ads join" keeps creating krb5.keytab file in it's default location (/etc) even if a different location (say /var/lib/samba) is specified in /etc/krb5.conf

Comment 8 Andrej Dzilský 2017-04-28 09:54:34 UTC
Well. Let's start with:

rpm -qa | grep samba
cat /etc/samba/smb.conf
cat /etc/krb5.conf

also run 'net ads join' with parameter '-d10' and attach the log, (e.g. 'net ads join -d10 &> log.join') 

Can I ask you if u entered just 'net ads join' without any parameters or ?

I'd like to find that little detail which prevents me to reproduce bug.

Regards.

Comment 12 Andreas Schneider 2017-05-08 16:45:09 UTC
> Which other info shall I provide?
> The steps to reproduce are still the same - "net ads join" keeps creating
> krb5.keytab file in it's default location (/etc) even if a different location
> (say /var/lib/samba) is specified in /etc/krb5.conf

See 'dedicated keytab' in 'man smb.conf'.

Comment 13 Ondrej 2017-05-09 08:17:39 UTC
Does not work either, unfortunately.
When I add:
    kerberos method = dedicated keytab
    dedicated keytab file = /var/lib/samba/krb5.keytab

and then "net ads join", krb5.keytab file is never created.

Comment 14 Andreas Schneider 2017-05-09 08:36:04 UTC
You need to call 'net ads keytab create'.

Comment 15 Ondrej 2017-05-09 09:17:17 UTC
When I call 'net ads keyteb create -U admin', krb5.keytab is still created in /etc, ignoring settings in both /etc/krb5.conf and /etc/samba/smb.conf

Comment 16 Ondrej 2017-05-09 11:51:45 UTC
Created RedHat support case #01845954 to support this

Comment 17 Andrej Dzilský 2017-05-22 10:28:05 UTC
Kerberos method with 'dedicated keytab' works on samba 4.6.0 too.

Comment 18 errata-xmlrpc 2017-08-01 18:19:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:1950