Monday, August 15, 2016


Steps to join a Linux computer to Active Directory using AD are as follows:
First, the benefits of using SSSD:
  • ·         Reduced load on authentication servers.
  • ·         Option for offline authentication
  • ·         Single user account


Steps:
1)  Make sure that both the Active Directory and Linux systems have a properly configured environment
2)  On the Linux client, add the Active Directory domain to the client's DNS configuration so that it can resolve the domain's SRV records.
Search adserver.example.com
Nameserver 192.168.1.1
3) Set up the linux system as an AD client and enroll it within the AD domain.
   1) set up the kerberos to use AD realm
         1) vim /etc/krb5.conf
         2) configure the logging and libdefaulrs section
              [Logging]
               FILE: /var/logs/krb5libs.log
               [Libdefaults]
               Default_realm=example.com
               Dns_lookup_realm=true
               Dns_lookup_kdc = true
               Ticket_lifetime=24h
               Renew_lifetime=7d
               Rdns = false
               Forwardable = yes
     2) Configure the samba server to connect to AD server
           1) vim /etc/samba/smb.conf
           2) configure [globals]
[global]
workgroup = EXAMPLE
client signing = yes
client use spnego = yes
kerberos method = secrets and
keytab log file = /var/log/samba/%m.log password server = AD.EXAMPLE.COM
realm = EXAMPLE.COM
security = ads

3)  add the linux machine to the AD domain.
Kinit Adninistrator
Net ads join -k
Klist -k

4) configure sssd
[sssd]
 config_file_version = 2
 domains = ad.example.com
 services = nss, pam, pac

Create a new domain section at the bottom of the file for the Active Directory domain. This section has the format domain/NAME, such as domain/ad.example.com. For each provider, set the value to ad, and give the connection information for the specific Active Directory instance to connect to.
[domain/ad.example.com]
 id_provider = ad
 auth_provider = ad
chpass_provider = ad
 access_provider = ad


#codingexercise
Find the maximum width of a binary tree where the width is the count of nodes at a given level
int GetMaxWidth(Node root)
{
int max  = 0;
for (int i =l; i < height(root); i++){
      int count = GetWidth(root, i);
      if (count > max)
           max = count;
}
return root;
}
int GetWidth(Node root, int level)
{
 if (root == null) return 0;
 if (level == 1) return 1;
 if (level > 1){
        return GetWidth(root.left, level -1) + GetWidth(root.right, level-1);
}
return 0;
}

#monty hall problem
 A tv show host gives you the option to open one of three doors behind one of which is a car and the others have goats. You pick a door and the tv show host picks another. His door has goat. Do you want to switch doors ?
Solution to the above problem is that you should switch because the probability that the second door hides the car has increased to 2/3.
Previously, the two remaining doors haf a combined probability of 2/3 but with the hosts choice, that probability has now become entirely that of one unopened door to switch to

An employee works for an employer for 7 days. The employer has a gold rod of 7 units. How does the employer pays to the employee so that the employee gets 1 unit at the end of everyday.The employer can make at most 2 cuts in rod.
Solution : the rod should be cut in 4,2,1 length pieces.

A box contains n coins, of which 7 of them are counterfeit with tails on both sides and the rest are fair coins. If one coin is selected from the bag and tossed, the probability of getting a tail is 17/20. Find the value of ‘n’.
N = 2. Working backwards from the last pèrson.
7/n x 1 + (n-7)/n x 1/2 = 17/20
N = 10 

A boy goes to 20 of his friend’s houses with ‘n’ number of newly purchased marbles in his hands. At every house he visits , he gives away half of marbles he have and take one of his friend’s marble’s and adds it with the one’s he is left with , he never had a problem of dividing an odd number of marbles left and finally after leaving the his 20th friends house, he is left with 2 marbles, can you guess the ‘n’ value?



No comments:

Post a Comment