Last active
May 1, 2020 13:34
-
-
Save nzbart/9018aac0004f11127af01fe61b0e4884 to your computer and use it in GitHub Desktop.
Join a Debian/Ubuntu based server to a Windows domain so that users can ssh with domain credentials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace example.com with your domain | |
hostnamectl set-hostname <hostname>.example.com # FQDN required for DNS registrations by realm (not sure why) | |
mkdir -p /var/log/journal # Persist logs across reboots | |
apt update && apt full-upgrade -y && apt auto-remove -y # Get software up to date | |
apt install -y unattended-upgrades packagekit realmd dnsutils sudo # Install required packages | |
pam-auth-update --enable mkhomedir # Allow automatic creation of home directories for domain users | |
echo '%domain\ admins@example.com ALL=(ALL:ALL) ALL' > /etc/sudoers.d/example.com # Allow all domain users to act as root in high-trust environments | |
ssh-keyscan localhost | ssh-keygen -lf - # Take a record of the SSH keys for secure login | |
realm join -v -U <your unqualified domain user name> example.com # Join domain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment