Skip to main content

Offline Windows AD domain join tool for Samba

Implements a custom smb-net-ads-join utility, which performs the same operation as net ads join Samba command, but works completely offline.

To join a Samba system to an AD domain it needs SYSTEM, SECURITY and SAM registry hive files from a Windows system that is already joined to the same domain.

Usage

usage: smb-net-ads-join [-h] [-v] [-V] [-J] [-o FILE] DIR

positional arguments:
  DIR                   Windows registry hive files directory (e.g. '/Windows/System32/config')

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         print intermediate results and debug info
  -V, --version         show program's version number and exit
  -J, --json            generate 'secrets.json' file in place of 'secrets.tdb'
  -o FILE, --output FILE
                        generated 'secrets.tdb' file name and location

Example invocation

Assuming that Windows drive C:\ is mounted to /mnt/windows/:

$ smb-net-ads-join /mnt/windows/Windows/System32/config
Using short domain name -- DOMAIN
Joined 'HOSTNAME' to realm 'domain.company.com'

A new database file secrets.tdb is created in the current directory.

It must be placed into /var/lib/samba/private/ and, with an appropriate smb.conf configuration, winbindd will run as if net ads join command was executed.

Common errors

When the Windows machine is not joined to an ADS domain:

$ smb-net-ads-join /mnt/windows/Windows/System32/config
WARNING:smbjoin.cli:Registry hive access failed: Did not find $MACHINE.ACC at Policy
CRITICAL:smbjoin.cli:Extracting secrets failed: Machine account password key does not exist
error: Domain machine account data was not found in the registry

Metadata

Release files for smbjoin 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smbjoin 0.1.1
File Size Uploaded Provenance Actions
smbjoin-0.1.1.tar.gz 7.8 kB Without provenance Details for smbjoin-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smbjoin 0.1.1
File Interpreter ABI Platform Actions
smbjoin-0.1.1-py3-none-any.whl Python 3 none any Details for smbjoin-0.1.1-py3-none-any.whl

Total release size: 16.9 kB

Release files / smbjoin-0.1.1.tar.gz

Download URL smbjoin-0.1.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
be9655c5745c477a7ca0edc676deb103f3b44f678035c3e0c1424be36819d194
BLAKE2b-256 checksum
How to use checksums
750f0ff3f3317e46d150bfae67127ff31fcdd6de791a0ab6b52727d5d493f326
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / smbjoin-0.1.1-py3-none-any.whl

Download URL smbjoin-0.1.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86108c9298cb5c9eba59d868ff7d26444d95512199f0889eac59f545b6a22a8c
BLAKE2b-256 checksum
How to use checksums
ce7a6d7254e3494de5fa312c46594e2a2a0f24ce28ce6c533268a57c4c0af3b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Security for smbjoin 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page