Running a Systemd service as a Windows AD user?

Greetings all,

I’m wondering if it’s possible to run a Systemd service as a Windows user on a domain joined Ubuntu 18.04 machine or indeed if there’s a better way to achieve what I’m looking to do?

I have an Ubuntu VM that’s joined to a Windows Server 2016 domain, this Ubuntu machine runs some software as a service via Systemd that generates a bunch of large files (40-60GB each) which I would like to end up on a Samba share for archiving.

The software has an option for where the output is stored but it doesn’t have write permission to the Samba share as the user Systemd runs it under larg-user

I notice that in Systemd there is a User and Group field but no password so I’m not sure how I would specify the credentials for the domain user?

Does anyone have any bright ideas?
Thanks in advance

Steve

[Unit]
Description=Location Argument Daemon
After=network.target

[Service]
User=larg-user
Group=larg

Type=simple
ExecStart=/usr/bin/mono /opt/LARG/LARG.exe -nobrowser
TimeoutStopSec=50
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

Your using sssd for Ubuntu connecting to AD? You may need to login once (can’t remember) so that Ubuntu can generate Linux equivalent environment for the user. Otherwise is samba set up to allow the user access by default without the user needing to do anything further?

I’m using Winbind as SSSD was giving me a lot of grief.

Ah good point about the logging in, I don’t think I’ve logged in as that user before as it’s a “service account” shudders

I’m not sure on this point actually, is that something I’d need to set in the share permissions?

Wait…
I’ve just noticed this service is using mono to run an .exe :unamused:

I’m going to have a look at see if I can get this to run natively under Windows.
If so then this will be irrelevant.

Man I hate inheriting infrastructure!

Edit: with much faffing the service is now running on Windows. :slight_smile:

1 Like