<div dir="ltr">Hi Alexander,<div><br></div><div>Huzzah! </div><div><br></div><div>Thanks for explaining how gethostname() works. At least armed with this information I can make a case to the powers that be why we need to make a change like this.</div><div><br></div><div>So does this mean that all servers should have a fqdn in /etc/hostname or in the case of RHEL6 setting the HOSTNAME variable in /etc/sysconfig/network?</div><div><br></div><div>Thanks a ton for your help!</div><div><br></div><div>Best Regards,</div><div>Jon A</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 27, 2016 at 3:16 PM, Alexander Bokovoy <span dir="ltr"><<a href="mailto:abokovoy@redhat.com" target="_blank">abokovoy@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 27 Jan 2016, Jon wrote:<br>
</span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Alexander,<br>
<br>
I've changed the names to anonymize the logs, but have maintained the<br>
structure of the names.<br>
<br>
This is how I've got the hostname configured:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[root@freeipaserver ~]# hostname<br>
freeipaserver<br>
[root@freeipaserver ~]# hostname -a<br>
freeipaserver<br>
[root@freeipaserver ~]# hostname -f<br>
<a href="http://freeipaserver.my.sub.domain.com" rel="noreferrer" target="_blank">freeipaserver.my.sub.domain.com</a><br>
[root@freeipaserver ~]# cat /etc/hosts<br>
127.0.0.1 localhost localhost.localdomain localhost4<br>
</blockquote></blockquote>
localhost4.localdomain4<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
::1 localhost localhost.localdomain localhost6<br>
</blockquote></blockquote>
localhost6.localdomain6<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
192.168.1.10 <a href="http://freeipaserver.my.sub.domain.com" rel="noreferrer" target="_blank">freeipaserver.my.sub.domain.com</a> freeipaserver<br>
<br>
[root@freeipaserver ~]# cat /etc/sysconfig/network<br>
DNS1=192.168.10.1<br>
NISDOMAIN=<a href="http://my.sub.domain.com" rel="noreferrer" target="_blank">my.sub.domain.com</a><br>
GATEWAY=192.168.1.1<br>
SEARCH=<a href="http://my.sub.domain.com" rel="noreferrer" target="_blank">my.sub.domain.com</a><br>
DOMAIN=<a href="http://my.sub.domain.com" rel="noreferrer" target="_blank">my.sub.domain.com</a><br>
</blockquote></blockquote>
<br>
(NISDOMAIN and DOMAIN were previous attempts to set the domain. I can't<br>
just set /etc/hostname to "freeipaserver" as a bash prompt that says [<br>
<a href="mailto:root@freeipaserver.my.sub.domain.com" target="_blank">root@freeipaserver.my.sub.domain.com</a> ~] is unacceptable to our ops teams,<br>
and we can't rewrite our bashrcs (these are company standards). However,<br>
based on the instructions, I do believe I've set the hostname correctly<br>
unless something has changed between RHEL6 and RHEL7).<br>
</blockquote></div></div>
So this is not going to work, sorry.<br>
<br>
One way or another, Kerberos requires you to have uniform names, so<br>
freeipaserver and <a href="http://freeipaserver.my.sub.domain.com" rel="noreferrer" target="_blank">freeipaserver.my.sub.domain.com</a> are different names<br>
and thus cifs/freeipaserver@REALM and cifs/freeipaserver.my.sub.domain.com@REALM<br>
are two different Kerberos principals. FreeIPA KDC does not support aliases.<br>
<br>
Almost all software using Kerberos is retrieving hostname using<br>
gethostname() call which, in turn, uses uname() system call and copies<br>
hostname from a nodename element of the returned structure. There is no<br>
code that complements nodename with default domain or something, so<br>
that output has to be fully qualified or ALL hosts in your deployment<br>
would need to non-fully qualified.<br>
<br>
`hostname` output is essentially giving you what uname() returns in<br>
nodename, while `hostname -f` appends default domain to it.<br>
<br>
Company standards may be important but in this case your bashrc code is<br>
clearly based on something that is not really taking Kerberos reality<br>
into account.<span class="HOEnZb"><font color="#888888"><br>
-- <br>
/ Alexander Bokovoy<br>
</font></span></blockquote></div><br></div>