Bug 35981 - Program to join an Ubuntu client
Program to join an Ubuntu client
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Univention Domain Join (Ubuntu)
UCS 4.2
Other Linux
: P5 enhancement (vote)
: UCS 4.3-0-errata
Assigned To: Richard Ulmer
Erik Damrose
https://github.com/univention/univent...
:
Depends on: 46177 46655 46658
Blocks: 46202 46737 46866
  Show dependency treegraph
 
Reported: 2014-09-22 21:21 CEST by Stefan Gohmann
Modified: 2018-05-02 15:41 CEST (History)
7 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016011221000504, 2016053021000661
Bug group (optional): External feedback, Roadmap discussion (moved)
Max CVSS v3 score:


Attachments
ubuntu1710_configure_systemd_resolver_and_lookup_domainctontroller_master.sh (3.77 KB, application/x-shellscript)
2017-12-19 16:03 CET, Arvid Requate
Details
Screenshot of the GUI's main window on Ubuntu 16.04 (381.03 KB, image/png)
2018-01-16 13:54 CET, Richard Ulmer
Details
New design (377.47 KB, image/png)
2018-01-19 11:25 CET, Richard Ulmer
Details
.deb package of the base tool (16.43 KB, application/vnd.debian.binary-package)
2018-01-19 11:39 CET, Richard Ulmer
Details
.deb package of the gui (depends on the base tool) (2.69 KB, application/vnd.debian.binary-package)
2018-01-19 11:39 CET, Richard Ulmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2014-09-22 21:21:33 CEST
We should create and distribute a graphical tool to join an Ubuntu client into a UCS domain. The tool should ask for the domain name and the admin credentials.
Comment 1 Stefan Gohmann univentionstaff 2014-09-22 21:30:12 CEST
This tool should replace this documentation:
 http://docs.univention.de/domain-3.2.html#ext-dom-ubuntu
Comment 2 Stephan Luft univentionstaff 2016-01-14 11:02:56 CET
demanded from a customer (Ticket#2016011221000504)
Comment 3 Stefan Gohmann univentionstaff 2017-06-20 13:27:16 CEST
Requested here: Ticket #2016053021000661
Comment 4 Stephan Luft univentionstaff 2017-10-23 11:03:56 CEST
An older approach (2013) from Jan Christoph:
https://github.com/jceb/ucs-domjoin
Comment 5 Richard Ulmer univentionstaff 2017-11-30 14:49:27 CET
I reimplemented and improved the existing scripts in a python-tool which can be found here:
https://git.knut.univention.de/rulmer/univention-domain-join

The tool is not packaged yet so dependencies need to be installed manually via:
`DEBIAN_FRONTEND=noninteractive apt-get install -y sssd libnss-sss libpam-sss libsss-sudo auth-client-config heimdal-clients ntpdate sshpass`

The tool can then be run via:
`python cli.py $MASTER_IP`
Comment 6 Richard Ulmer univentionstaff 2017-12-19 09:34:52 CET
The tool has been updated to find the DC master via DNS on it's own, support the GDM login manager and not offer the --force parameter.

Also first attempts with packaging for Debian have been made. See Bug #45801 for this.
Comment 7 Arvid Requate univentionstaff 2017-12-19 15:46:09 CET
Ok, basically this works. I suggest logging tracebacks and actions into a logfile. This gives people the opportuinity to report meaningful information in case errors happen.
Comment 8 Arvid Requate univentionstaff 2017-12-19 16:03:28 CET
Created attachment 9321 [details]
ubuntu1710_configure_systemd_resolver_and_lookup_domainctontroller_master.sh

Now for the fine tuning of the user experience: I think the goal should be that the script works in 100% of the cases we can test here. Now, with by Ubuntu 17.10 client I have the issue that I first need to configure /etc/hosts manually to make dnsdomainname return the domain I want to join to. My idea of use experience would be, that the new join tool should configure things as much "hands off" as possible and precisely ask the user to do things in cases where automatising thins is hard (or error prone). With regard to the dnsdomainname I would see two options:

A) make the domainname an explicit mandatory argument of the script. This makes it clear to the user that his is something that (s)he has to provide. Maybe you even can ignore the output dnsdomainname if not strictly required for some technical reason. Try to lookup the _domaincontroller_master._tcp SRV record (as your code currently does) and if that fails report to the user that that exact record cannot be resolved and manual DNS configuration is therefore required before running the tool again.

B) Solve the problem for the user, if a stable approach can be found for this. The attached bash script e.g. takes an IP and, similar to univention-join, asks the user for ssh credentials to look up all required information. Then it (1) configures the local DNS resolver (in the case of Ubuntu 17.10 that is systemd-resolved) and checks that the _domaincontroller_master._tcp SRV record is resolvable. (2) It optionally sets dnsdomainname by adjusting /etc/hosts, don't know if that is required. I don't known how stable this approach is and what steps are required for other Ubuntu versions, but it seems possible from my point of view.
Comment 9 Richard Ulmer univentionstaff 2018-01-08 11:37:23 CET
I've adapted the tool to address the problem mentioned in Comment #8.

The tool now requires the masters IP address as a parameter. It then fetches the domain name and nameservers from the masters UCR and configures the name servers automatically. The tool will automatically detect if it has to use `systemd-resolved` or `resolvconf` to configure DNS. I've tested it for Ubuntu 14.04, 16.04, 17.10 and Kubuntu 14.04, 16.04 (doesn't work, which is expected).

The only problem that occurred to me is that you will get a rather hard to understand traceback, when you configured a name server (which is not the DC master) manually before using the tool. I think this is acceptable for now, because I assume this will rarely occur and because fixing this would require messing around with the Ubuntu network manager.

Also tracebacks are now logged to a log-file.
Comment 10 Richard Ulmer univentionstaff 2018-01-09 10:28:15 CET
Stefan Gohmann requested that the join client asks the user name of the domain administrator, which should be used for the join. Also giving the IP of the DC master must not be a requirement. Instead the user should enter the domain name and the DC master should be determined using the _domaincontroller_master._tcp.DOMAINNAME DNS entry.
Comment 11 Stefan Gohmann univentionstaff 2018-01-09 10:31:32 CET
(In reply to Richard Ulmer from comment #10)
> Stefan Gohmann requested that the join client asks the user name of the
> domain administrator, which should be used for the join. Also giving the IP
> of the DC master must not be a requirement. Instead the user should enter
> the domain name and the DC master should be determined using the
> _domaincontroller_master._tcp.DOMAINNAME DNS entry.

I think it should be allowed to enter the IP address _or_ the domain name.
Comment 12 Arvid Requate univentionstaff 2018-01-09 12:15:39 CET
Yes, as I recommended: it should be comparable in functionality and usage with the regular univention-join. (It doesn't need to have the exact same option names though.)
Comment 13 Richard Ulmer univentionstaff 2018-01-09 12:42:07 CET
Well, in Comment #8 you suggested that the tool should work hands off in 100% of the cases. That's why I removed the automatic discovery of the DC master via _domaincontroller_master._tcp.DOMAINNAME; it required the DNS server and domainname of the client to be set correctly.

I will re-introduce this feature and change it, so that it requires the domainname as a parameter now. If the tool then cannot resolve _domaincontroller_master._tcp.DOMAINNAME it will exit and ask the user to either configure the DNS server correctly (must be the DC master) or use the tool with the masters IP instead.

This way the tool can be used similar to the join process in Windows clients. I haven't yet compared the tool to the 'regular univention-join', because I don't know where to find this tool / what it does.
Comment 14 Richard Ulmer univentionstaff 2018-01-10 11:27:36 CET
The tool now takes user credentials as an input, instead of using root.

Also the tool now tries to determine the domain name automatically. If that doesn't work the user can either give the domain name or the IP address of the DC master to the tool.
Comment 15 Richard Ulmer univentionstaff 2018-01-16 13:50:30 CET
The tool now also got a GUI, which can be started via the start menu. It can be found in the "gui" branch and is already packaged in the "debian_packaging" branch at https://git.knut.univention.de/rulmer/univention-domain-join .
Comment 16 Richard Ulmer univentionstaff 2018-01-16 13:54:52 CET
Created attachment 9346 [details]
Screenshot of the GUI's main window on Ubuntu 16.04
Comment 17 Richard Ulmer univentionstaff 2018-01-19 11:25:15 CET
Created attachment 9352 [details]
New design

After talking to the marketing team the GUI-Design has been updated.
Comment 18 Richard Ulmer univentionstaff 2018-01-19 11:39:09 CET
Created attachment 9353 [details]
.deb package of the base tool
Comment 19 Richard Ulmer univentionstaff 2018-01-19 11:39:40 CET
Created attachment 9354 [details]
.deb package of the gui (depends on the base tool)
Comment 20 Stefan Gohmann univentionstaff 2018-01-27 18:54:56 CET
The join client removes the Ubuntu client before joining. In addition, it works only if the client is located below cn=computers.

If the client doesn't exist, it should be created below cn=computers. If it exists, it should be modified.
Comment 21 Stefan Gohmann univentionstaff 2018-01-27 19:27:38 CET
Currently, we have the tools univention-domain-join and univention-domain-join-gui. I think the GUI tool should be univention-domain-join and the none GUI tool should be univention-domain-join-cli or something similar.
Comment 22 Stefan Gohmann univentionstaff 2018-01-27 19:36:53 CET
It looks like \n are added to the OS and OS version fields:

root@master421:~# univention-ldapsearch cn=stefan-Standard-PC-i440FX-PIIX-1996 univentionOperatingSystemVersion univentionOperatingSystem -LLL
dn: cn=stefan-Standard-PC-i440FX-PIIX-1996,cn=computers,dc=deadlock42,dc=intra
 net
univentionOperatingSystemVersion:: MTYuMDQK
univentionOperatingSystem:: VWJ1bnR1Cg==

root@master421:~# univention-ldapsearch cn=stefan-Standard-PC-i440FX-PIIX-1996 univentionOperatingSystemVersion univentionOperatingSystem -LLL | ldapsearch-decode64 
dn: cn=stefan-Standard-PC-i440FX-PIIX-1996,cn=computers,dc=deadlock42,dc=intra
 net
univentionOperatingSystemVersion: 16.04

univentionOperatingSystem: Ubuntu


root@master421:~#
Comment 23 Richard Ulmer univentionstaff 2018-01-29 14:10:18 CET
The newline characters are now stripped from the release name and version before writing to the LDAP.

Also the command line tool is now callable with the command univention-domain-join-cli. The GUI is callable with the command univention-domain-join (or univention-domain-join-sudo-wrapper).

Existing LDAP machine-objects won't be replaced anymore, but will be modified. Even if they aren't located in cn=computers.

The current code can now be found under the master branch at https://git.knut.univention.de/rulmer/univention-domain-join .
Comment 24 Nico Gulden univentionstaff 2018-02-21 11:18:12 CET
The GitHub repository does not include license information. Same for the source files. They are missing the usual header about the copyright and the license.

Please add a LICENSE file to the project and also the copyright header to the source files.
Comment 25 Arvid Requate univentionstaff 2018-02-21 12:00:46 CET
In detail:

README.md should either point to a LICENSE file or (more ugly) to https://github.com/univention/univention-domain-join/blob/master/debian/copyright

Run ucs-lint on the on the package to check ucs policy conformance (copyright headers etc).
Comment 26 Richard Ulmer univentionstaff 2018-02-22 11:50:14 CET
I've added a LICENSE file, added a reference to it in the README.md and added license information to all files ucslint asked me to.

In git/univention-domain-join:
1b3274e20510 | Bug #35981: Fix license notes
Comment 27 Richard Ulmer univentionstaff 2018-02-22 16:32:17 CET
8d6fe8d799cf | Bug #35981: Add missing license notes
Comment 28 Erik Damrose univentionstaff 2018-02-23 11:53:44 CET
While testing bug #33214 i tested the ubuntu joinclient. Some points i found:

There are errors while writing the krb5.conf, variable substitution does not work in some cases because of typos:

'%(kerberos_realm)s = {\n' \
'   kdc = %(master_ip)s $(ldap_master)s\n' \
'   admin_server = %(master_ip)s %(ldap_master)s\n' \
'   kpasswd_server = %(master_ip) %(ldap_master)s\n' \

results in the following beeing written into krb5.conf

UCS.LOCAL = {
   kdc = 10.200.29.95 $(ldap_master)s
   admin_server = 10.200.29.95 master.ucs.local
   kpasswd_server = %(ldap_master)s

==
I think the installation documentation could be improved. Currently, when installing, a debconf question about the kerberos realm is shown. This is irrelevant and confusing for the user, as the domain join tool will overwrite these settings anyway
Comment 29 Richard Ulmer univentionstaff 2018-02-23 12:55:58 CET
I've fixed the problems mentioned in Comment #28.

ef403abb8b74 | Bug #35981: Update changelog
68c822066c8f | Bug #35981: Improve installation instructions
a2daba998cc4 | Bug #35981: Fix bug with string formatting
Comment 30 Hendrik Peter univentionstaff 2018-03-14 12:15:36 CET
Reopened due to Bug(s) / Feature request(s):
#46655
#46658
#46659
Comment 31 Arvid Requate univentionstaff 2018-04-17 16:17:16 CEST
Regarding the "dhcp" issue reported in the forum, Eric just suggested that the /etc/nsswitch-conf line:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

needs to be adjusted to have "dns" before the "[NOTFOUND=return]". That seemed to help.

Regarding Bug #46659 is an enhancement bug and should not block the first release.
Comment 32 Arvid Requate univentionstaff 2018-04-19 19:00:38 CEST
Hmm, I cannot reproduce the "dhcp" issue currently with 17.10, so I cannot confirm that the suggestion from comment 31 really helps.

Anyway, I've commited some changes to the ubuntu17.10 branch and cherrypicked them to the other three:

6988926 Bug #35981: Focus password field if domain dection worked
c61303f Bug #35981: Properly handle SSH "No route to host"
fd9cd5c Bug #35981: Make log file path copyable via mouse
95effa5 Bug #46178: connect enter to join button

I didn't commit new changelog versions yet.
Comment 33 Arvid Requate univentionstaff 2018-04-23 14:20:25 CEST
I've also commited this feature:

47aa10c | Adjust nsswitch.conf when joining a .local domain

I'll do QA for Bug #46737 now, after that we need to update the changelogs.
Comment 34 Arvid Requate univentionstaff 2018-04-25 17:21:52 CEST
Updates for Bug #46202, Bug #46866 and Bug #46737 are pushed to git, new source packages have been generated, signed and uploaded to launchpad. Launchpad has successfully built the packages for bionic, artful, xenial and trusty. Setting back to resolved.
Comment 35 Erik Damrose univentionstaff 2018-04-25 17:23:38 CEST
OK: 18.04, 17.10, 16.04, 14.04
OK: Updates networkmanager config correctly
OK: Available via ppa
Comment 36 Arvid Requate univentionstaff 2018-05-02 15:41:43 CEST
Published as version 1.0-11:
 https://launchpad.net/~univention-dev/+archive/ubuntu/ppa