Join a Red Hat Enterprise Linux 7 Virtual Machine to Azure AD Domain Services

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.

  1. Log in to the Azure portal at http://portal.azure.com.
  2. Click the New button found on the upper left-hand corner of the Azure portal.
  3. Select Compute, and then select Red Hat Enterprise Linux 7.4. Choose Resource Manager as a deployment model then click Create.

clip_image001[1]

  1. Configure the basic settings for the virtual machine on the Basics page of the wizard. For Authentication type I choose Password.

clip_image001[3]

  1. Select a Size for the virtual machine. To see more sizes, select View all or change the Supported disk type filter.

clip_image001[5]

  1. 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.

clip_image001[7]

clip_image001[9]

  1. On the Purchase page, review the settings and click OK to deploy the virtual machine.

clip_image001[11]

  1. The VM deployment is pinned to the Azure portal dashboard.

image

  1. After the deployment complete, you can see information about the VM in the Overview page.

image

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.

  1. Download & Install Putty in order to connect Red Hat VM.

http://www.putty.org/

  1. To connect to your VM, type IP Public VM in the putty. If prompted, click Connect.

image

  1. At the login prompt, enter your local administrator credentials, which you specified while creating the virtual machine.

clip_image001[13]

clip_image001[15]

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

  1. In your SSH terminal, edit the /etc/hosts file and update your machine’s IP address and hostname.

sudo vi /etc/hosts

  1. 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

  1. 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

clip_image001[17]

clip_image001[19]

clip_image001[21]

clip_image001[23]

clip_image001[25]

clip_image001[27]

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>

clip_image001[29]

2. Initialize Kerberos. In your SSH terminal, type the following command:

kinit domainadmin@YOURDOMAIN

image

3. Join the machine to the domain. In your SSH terminal, type the following command:

sudo realm join –verbose <YOUR DOMAIN> -U ‘domainadmin@YOURDOMAIN’

image

You should get a message (“Successfully enrolled machine in realm”) when the machine is successfully joined to the managed domain.

image

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.

pwd

3. In your SSH terminal, type the following command to see if the group memberships are being resolved correctly.

id

clip_image001[31]

Leave a Reply