After we success join Windows Server 2016 on Azure to Azure AD Domain Services next I will try to join a Red Hat Enterprise Linux 7 to Azure AD Domain Services.I start with create one VM on azure.
- Log in to the Azure portal at http://portal.azure.com.
- Click the New button found on the upper left-hand corner of the Azure portal.
- Select Compute, and then select Red Hat Enterprise Linux 7.4. Choose Resource Manager as a deployment model then click Create.
- Configure the basic settings for the virtual machine on the Basics page of the wizard. For Authentication type I choose Password.
- Select a Size for the virtual machine. To see more sizes, select View all or change the Supported disk type filter.
- On the Settings page of the wizard, select the virtual network in which your Azure AD Domain Services managed domain is deployed. Pick a different subnet than the one your managed domain is deployed into. For the other settings, keep the defaults and click OK.
- On the Purchase page, review the settings and click OK to deploy the virtual machine.
- The VM deployment is pinned to the Azure portal dashboard.
- After the deployment complete, you can see information about the VM in the Overview page.
Connect to the Red Hat Enterprise virtual machine using the local administrator account.
The RHEL 7.4 virtual machine has been provisioned in Azure. The next task is to connect remotely to the virtual machine using the local administrator account created while provisioning the VM.
Perform the following steps to connect to the virtual machine.
- Download & Install Putty in order to connect Red Hat VM.
- To connect to your VM, type IP Public VM in the putty. If prompted, click Connect.
- At the login prompt, enter your local administrator credentials, which you specified while creating the virtual machine.
At this point, you should be logged in to the newly created Red Hat virtual machine using local Administrator credentials. The next step is to join the virtual machine to the domain.
Configure the hosts file on the Linux virtual machine
- In your SSH terminal, edit the /etc/hosts file and update your machine’s IP address and hostname.
sudo vi /etc/hosts
- In the hosts file, enter the following value:
<IP DNS Azure AD Domain Services> space <hostname.domain> space <Hostname>
exit & save
Install required packages on the Linux virtual machine
- Next, install packages required for domain join on the virtual machine. In your SSH terminal, type the following command to install the required packages:
sudo yum install realmd sssd krb5-workstation krb5-libs
Join the Linux virtual machine to the managed domain
Now that the required packages are installed on the Linux virtual machine, the next task is to join the virtual machine to the managed domain.
1. Discover the AAD Domain Services managed domain. In your SSH terminal, type the following command:
sudo realm discover <YOUR DOMAIN>
2. Initialize Kerberos. In your SSH terminal, type the following command:
3. Join the machine to the domain. In your SSH terminal, type the following command:
sudo realm join –verbose <YOUR DOMAIN> -U ‘domainadmin@YOURDOMAIN’
You should get a message (“Successfully enrolled machine in realm”) when the machine is successfully joined to the managed domain.
Verify domain join
Verify whether the machine has been successfully joined to the managed domain. Connect to the domain joined RHEL VM using a different SSH connection. Use a domain user account and then check to see if the user account is resolved correctly.
1. In your SSH terminal, type the following command to connect to the domain joined RHEL virtual machine using SSH. Use a domain account that belongs to the managed domain (for example, ‘me@FAZAR.WORK’ in this case.)
ssh –l <DOMAIN USER> space<HOSTNAME.DOMAIN>
2. In your SSH terminal, type the following command to see if the home directory was initialized correctly.
3. In your SSH terminal, type the following command to see if the group memberships are being resolved correctly.