0158.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Add Debian/Ubuntu Linux Device to Windows Active Directory</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Windows,Active Directory,Linux,Ubunut,Debian,Authentication,Tutorial,i12bretro,How To">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Add Debian/Ubuntu Linux Device to Windows Active Directory">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  12. <script type="text/javascript" src="includes/js/steps.js"></script>
  13. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  14. </head>
  15. <body>
  16. <div id="gridContainer">
  17. <div class="topMargin"></div>
  18. <div id="listName" class="topMargin">
  19. <h1>Add Debian/Ubuntu Linux Device to Windows Active Directory</h1>
  20. </div>
  21. <div></div>
  22. <div id="content">
  23. <h2>Installing Pre-Requesites and Configuration</h2>
  24. <ol>
  25. <li>Log into the Debian device and run the following commands in terminal:
  26. <div class="codeBlock">sudo apt-get update<br />
  27. # set the fully qualified host name<br />
  28. sudo hostnamectl set-hostname nettools.i12bretro.local<br />
  29. # confirm or add domain controller to DNS entries<br />
  30. sudo nano /etc/resolv.conf<br />
  31. sudo systemctl disable systemd-resolved<br />
  32. sudo systemctl stop systemd-resolved<br />
  33. sudo apt-get upgrade<br />
  34. # install required packages<br />
  35. sudo apt -y install realmd libnss-sss libpam-sss sssd sssd-tools adcli samba-common-bin oddjob oddjob-mkhomedir packagekit<br />
  36. sudo realm discover i12bretro.local</div>
  37. </li>
  38. <li>Paste the following text into /etc/krb5.conf
  39. <div class="codeBlock">[libdefaults]<br />
  40. dns_lookup_realm = false<br />
  41. ticket_lifetime = 24h<br />
  42. renew_lifetime = 7d<br />
  43. forwardable = true<br />
  44. rdns = false<br />
  45. default_realm = I12BRETRO.LOCAL<br />
  46. default_ccache_name = KEYRING:persistent:%{uid}</div>
  47. </li>
  48. <li>Press CTRL+O, Enter, CTRL+X to write the changes to /etc/krb5.conf</li>
  49. <li>Continue with the following commands in terminal:
  50. <div class="codeBlock">sudo realm join -U i12bretro i12bretro.local<br />
  51. # check the configured value of the domain<br />
  52. sudo realm list</div>
  53. </li>
  54. <li>Paste the following lines into terminal together to enable automatically creating user home directories:
  55. <div class="codeBlock">sudo bash -c &quot;cat &gt; /usr/share/pam-configs/mkhomedir&quot; &lt;&lt;EOF<br />
  56. Name: activate mkhomedir<br />
  57. Default: yes<br />
  58. Priority: 900<br />
  59. Session-Type: Additional<br />
  60. Session:<br />
  61. required pam_mkhomedir.so umask=0022 skel=/etc/skel<br />
  62. EOF</div>
  63. </li>
  64. <li>Continue with the following commands in terminal:
  65. <div class="codeBlock">sudo pam-auth-update</div>
  66. </li>
  67. <li>Arrow down to activate mkhomedir &gt; Press spacebar to select &gt; Press Enter to confirm</li>
  68. <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:
  69. <div class="codeBlock"># add specific user(s )<br />
  70. realm permit user1@i12bretro.local user2@i12bretro.local<br />
  71. # add specific group(s)<br />
  72. sudo realm permit -g &#39;LinuxUsers&#39; &#39;Linux Admins&#39;<br />
  73. # add everyone<br />
  74. sudo realm permit --all<br />
  75. # deny everyone<br />
  76. sudo realm deny --all</div>
  77. </li>
  78. <li>Similarly, run the following command to edit /etc/sudoers.d/domain_admins to add specific users or groups to the sudoers file:
  79. <div class="codeBlock">sudo nano /etc/sudoers.d/domain_admins<br />
  80. # add specific user(s )<br />
  81. user1@i12bretro.local ALL=(ALL) ALL<br />
  82. user2@i12bretro.local ALL=(ALL) ALL<br />
  83. # add specific group(s)<br />
  84. %LinuxUsers@i12bretro.local ALL=(ALL) ALL<br />
  85. %Linux\ Admins@i12bretro.local ALL=(ALL) ALL</div>
  86. </li>
  87. <li>Press CTRL+O, Enter, CTRL+X to write the changes to /etc/sudoers.d/domain_admins</li>
  88. </ol>
  89. <h2>Testing Active Directory Authentication</h2>
  90. <ol>
  91. <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>
  92. </ol>
  93. <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>
  94. </div>
  95. </div>
  96. </body>
  97. </html>