Score:1

sssd do not use corporate domain in PTR record when deployed with vSphere

US flag

We have a workflow that deploy Ubuntu 20.04.5 LTS in vSphere VM with automatic AD integration using the following commands:

#!/bin/bash
if [ x$1 == x"precustomization" ]; then
    rm -v /home/sysadmin/.bash_history /root/.bash_history
    rm -v /etc/ssh/ssh_host_*
    dpkg-reconfigure openssh-server
elif [ x$1 == x"postcustomization" ]; then
    echo "P@ssw0rd" | realm join --user "svc.vm.enroll" --computer-ou "OU=UNIX,OU=Managed Servers,DC=corp,DC=example,DC=com" --os-name "Ubuntu Server" corp.example.com

cat <<'EOF' > /tmp/sssd.awk
/^\[sssd\]$/ {
  print
  print "default_domain_suffix = corp.example.com"
  next
}

/^\[domain\/corp.example.com\]$/ {
  print
  print "ldap_user_ssh_public_key = altSecurityIdentities"
  next
}
1
EOF


    awk -f /tmp/sssd.awk -i inplace /etc/sssd/sssd.conf

    service sssd restart

    realm permit --groups "adm-unix@corp.example.com"

    landscape-config --computer-title "$(hostname)" --account-name standalone  --url https://landscape.corp.example.com/message-system --ping-url http://landscape.corp.example.com/ping --script-users=ALL --registration-key="key"
fi

Manually running the commands works well, but when executed in vSphere, it works too but the PRT record in the DNS is set to anhost. instead of anhost.corp.example.com

In /etc/hosts I have

127.0.0.1 localhost
127.0.1.1 template-ubuntu-server

# 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

10.0.0.123  anhost.corp.example.com anhost

And in /etc/resolv.conf the search domain is also the correct one

Manually fixing the PRT record in AD does not solve the issue, at each reboot or after a certain time, it got reverted to the wrong value

How can I fix that?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.