123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <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" />
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript">
- $(function(){
- $('textarea').each(function(i,e){
- theTextarea = $(this);
- theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
- });
- $('li').each(function(i,e){
- var uuid = 'li_' + Math.floor(Math.random() * Math.floor(1000000)).toString() + '_' + i.toString();
- $(this).contents().wrap('<span id="'+ uuid +'"><label for="cb_'+ uuid +'"></label></span>');
- $(this).prepend('<input type="checkbox" class="completeBox" id="cb_' + uuid +'" rel="'+ uuid +'" />')
- });
- $('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
- theElement = $(this);
- var lines = theElement.html().split("\n");
- theElement.empty();
- for(l=0;l<lines.length;l++){
- if($.trim(lines[l]) != '' && $.trim(lines[l]).substr(0,1) != '#' && $.trim(lines[l]).indexOf(' #') == -1 && lines[l].substr(0, 4).toUpperCase() != 'REM '){
- theElement.append('<input type="image" src="images/clipboard.png" value="" class="copy-text" rel="copy_'+ i +'_'+ l +'" data-clipboard-text="'+ lines[l].replace(/"/g, '"') +'" /><span id="copy_'+ i +'_'+ l +'">'+ lines[l] +'</span>');
- } else {
- theElement.append(lines[l]);
- }
- }
- });
- $(document).on('click','input.copy-text',function(){
- theButton = $(this);
- $('input.copy-text').attr('src','images/clipboard.png');
- $('span.copy-animation').removeClass('copy-animation');
- try {
- $('#'+ theButton.attr('rel')).addClass('copy-animation');
- navigator.clipboard.writeText(theButton.data('clipboard-text').replace(/<[^>]*>?/gm, ''));
- theButton.attr('src','images/clipboard_active.png');
- } catch(err) {
- }
- return false;
- });
- $(document).on('click','input.completeBox',function(){
- theBox = $(this);
- $('#'+ theBox.attr('rel')).addClass('strikethrough');
- theBox.prop('disabled',true);
- theBox.parent('li').prevAll().each(function(i,e){
- theLI = $(this);
- if(theLI.find('input[type=checkbox]').not(':checked')){
- $('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
- theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
- }
- });
- });
- if(window.self !== window.top){
- window.parent.$('iframe.stepsFrame').height((this['scrollingElement']['scrollHeight']+20) +'px');
- }
- });
- </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-get 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
- <div class="codeBlock">[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}</div>
- </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:
- <div class="codeBlock">sudo bash -c "cat > /usr/share/pam-configs/mkhomedir" <<eof<br> 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</eof<br></div>
- </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>
-
|