123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Add Debian/Ubuntu Linux Device to Windows Active Directory</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <meta name="keywords" content="How To Join Linux To Domain,How To Join Linux To Windows Active Directory,Windows,Active Directory,Linux,Ubuntu,Debian,Authentication,Home Lab,Self-Hosted,AD,Administration,Active Directory Management,Active Directory Administration,Windows Administration,System Administrator,Self-hosted,Network,Microsoft Windows,Microsoft,LDAP,Lightweight Directory Access Protocol,Install Guide,Home Networking,Domain,How To,Tutorial,i12bretro">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Add Debian/Ubuntu Linux Device to Windows Active Directory">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="revised" content="05/04/2022 10:09:24 AM" />
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Add Debian/Ubuntu Linux Device to Windows Active Directory</h1>
- </div>
- <div></div>
- <div id="content">
- <h2>Installing Pre-Requesites and Configuration</h2>
- <ol>
- <li>Log into the Debian device and run the following commands in terminal:
- <div class="codeBlock">sudo apt update<br />
- # set the fully qualified host name<br />
- sudo hostnamectl set-hostname nettools.i12bretro.local<br />
- # confirm or add domain controller to DNS entries<br />
- sudo nano /etc/resolv.conf<br />
- sudo systemctl disable systemd-resolved<br />
- sudo systemctl stop systemd-resolved<br />
- sudo apt-get upgrade<br />
- # install required packages<br />
- sudo apt -y install realmd libnss-sss libpam-sss sssd sssd-tools adcli samba-common-bin oddjob oddjob-mkhomedir packagekit<br />
- sudo realm discover i12bretro.local</div>
- </li>
- <li>Paste the following text into /etc/krb5.conf
- <p>[libdefaults]<br />
- dns_lookup_realm = false<br />
- ticket_lifetime = 24h<br />
- renew_lifetime = 7d<br />
- forwardable = true<br />
- rdns = false<br />
- default_realm = I12BRETRO.LOCAL<br />
- default_ccache_name = KEYRING:persistent:%{uid}</p>
- </li>
- <li>Press CTRL+O, Enter, CTRL+X to write the changes to /etc/krb5.conf</li>
- <li>Continue with the following commands in terminal:
- <div class="codeBlock">sudo realm join -U i12bretro i12bretro.local<br />
- # check the configured value of the domain<br />
- sudo realm list</div>
- </li>
- <li>Paste the following lines into terminal together to enable automatically creating user home directories:
- <p>sudo bash -c "cat > /usr/share/pam-configs/mkhomedir" <<EOF Name: activate mkhomedir<br />
- Default: yes<br />
- Priority: 900<br />
- Session-Type: Additional<br />
- Session:<br />
- required pam_mkhomedir.so umask=0022 skel=/etc/skel<br />
- EOF</p>
- </li>
- <li>Continue with the following commands in terminal:
- <div class="codeBlock">sudo pam-auth-update</div>
- </li>
- <li>Arrow down to activate mkhomedir > Press spacebar to select > Press Enter to confirm</li>
- <li>Run one or more of the following commands in terminal to grant active directory users or groups access to log into the linux machine:
- <div class="codeBlock"># add specific user(s )<br />
- realm permit user1@i12bretro.local user2@i12bretro.local<br />
- # add specific group(s)<br />
- sudo realm permit -g 'LinuxUsers' 'Linux Admins'<br />
- # add everyone<br />
- sudo realm permit --all<br />
- # deny everyone<br />
- sudo realm deny --all</div>
- </li>
- <li>Similarly, run the following command to edit /etc/sudoers.d/domain_admins to add specific users or groups to the sudoers file:
- <div class="codeBlock">sudo nano /etc/sudoers.d/domain_admins<br />
- # add specific user(s )<br />
- user1@i12bretro.local ALL=(ALL) ALL<br />
- user2@i12bretro.local ALL=(ALL) ALL<br />
- # add specific group(s)<br />
- %LinuxUsers@i12bretro.local ALL=(ALL) ALL<br />
- %Linux\ Admins@i12bretro.local ALL=(ALL) ALL</div>
- </li>
- <li>Press CTRL+O, Enter, CTRL+X to write the changes to /etc/sudoers.d/domain_admins</li>
- </ol>
- <h2>Testing Active Directory Authentication</h2>
- <ol>
- <li>Attempt to login to the Debian device either into a desktop environment or via SSH. The user name must be formatted like user1@i12bretro.local and the password will be the active directory password</li>
- </ol>
- <p>Additonal reading: <a href="https://computingforgeeks.com/join-ubuntu-debian-to-active-directory-ad-domain/" target="_blank">https://computingforgeeks.com/join-ubuntu-debian-to-active-directory-ad-domain/</a></p>
- </div>
- </div>
- </body>
- </html>
-
|