"net ads join" fails with "User session deleted" in systemd

Youzhong Yang Youzhong.Yang at mathworks.com
Fri Jan 11 19:13:50 UTC 2019

Hello Samba gurus,

I am struggling with a net ads join issue.

Here is what I need to do: we use openstack to spawn Debian VM, before handing the VM to user, we need to join it to Windows domain. This needs to be done automatically.

We run the following two commands to do the job:

kinit -k -t /path/to/keytab_file username at DOMAIN
net ads join --no-dns-updates createcomputer=... -k

If I run the above commands manually (in a terminal window), it works perfectly.

But since we need to run them in an automatic way, so first we tried clound-init, it failed; second we tried to run as a systemd service, the same failure:

Failed to join domain: failed to lookup DC info for domain 'DOMAIN' over rpc: User session deleted

It is definitely not an issue of some system services not ready, because when the host is ready for use, running the above two commands inside systemd produces the same error.

Could someone shed some light on what could be going wrong? By the way, I am running Debian 9.3, the Samba version installed on it is 4.5.12.

Thanks in advance,


More information about the samba-technical mailing list