Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Associer une VM Linux à un domaine
Cette page vous explique comment associer une VM Linux exécutant des distributions Linux compatibles à un domaine dans le service géré pour Microsoft Active Directory à l'aide du daemon System Security Services (SSSD).
L'interopérabilité Microsoft AD géré fonctionne pour de nombreuses distributions Linux et d'autres outils de connectivité. Découvrez ces outils de connectivité open source.
Créez la VM dans le projet qui héberge votre domaine Microsoft AD géré.
Si votre domaine Managed Microsoft AD dispose d'un VPC partagé en tant que réseau autorisé, vous pouvez également créer la VM dans l'un des projets de service de VPC partagé.
Créez la VM sur un réseau VPC que vous avez appairé avec le domaine Microsoft AD géré.
Installez realmd sur la VM. En savoir plus sur realm.
Pour obtenir des instructions, consultez la documentation Ubuntu et Red Hat.
Pour associer une VM Linux à un domaine, vous avez besoin des informations suivantes :
Nom de domaine de votre domaine Microsoft AD géré. Par exemple, mydomain.example.com.
Le nom d'utilisateur et le mot de passe d'un compte disposant des autorisations requises pour associer une VM au domaine. Par défaut, les membres du groupe Cloud Service Domain Join Accounts disposent de ces autorisations. Pour en savoir plus sur les groupes par défaut créés par Microsoft AD géré, consultez Groupes.
Le nom d'utilisateur doit être au format suivant : USERNAME@DOMAIN_NAME. La partie du nom d'utilisateur correspondant au nom de domaine doit être en majuscules. Par exemple, user@MYDOMAIN.EXAMPLE.COM.
Vous pouvez joindre la VM Linux au domaine Microsoft AD géré à l'aide de la commande realm
join. Voici un exemple de commande :
realm join DOMAIN_NAME -U 'USERNAME@DOMAIN_NAME'
Pour une sortie détaillée, ajoutez l'indicateur -v à la fin de la commande.
Spécifier l'emplacement du compte avec realm join
Par défaut, la commande realm join crée un compte d'ordinateur situé :
Pour spécifier où créer le compte, utilisez l'indicateur --computer-ou pour fournir le chemin d'accès à la commande realm join. L'exemple suivant montre comment spécifier le chemin d'accès :
L'utilisateur doit disposer des autorisations requises pour créer des comptes dans l'unité organisationnelle spécifiée.
Supprimer une VM Linux d'un domaine
Pour supprimer une VM Linux d'un domaine, vous avez besoin du nom de domaine de votre domaine Managed Microsoft AD et du nom d'utilisateur de votre compte utilisateur.
Vous pouvez supprimer une VM Linux du domaine Managed Microsoft AD à l'aide de la commande realm
leave. Voici un exemple de commande :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Quickstart: Join a Linux VM to a domain\n\nJoin a Linux VM to a domain\n===========================\n\nThis page shows you how to join a Linux VM, running [supported Linux\ndistributions](/managed-microsoft-ad/docs/os-versions#linux-domain-join), to a\ndomain in Managed Service for Microsoft Active Directory using the System Security Services Daemon (SSSD).\n\nManaged Microsoft AD interoperability works for many Linux distributions\nand other connectivity tools. Learn about\n[these open source connectivity tools](/managed-microsoft-ad/docs/connect-to-active-directory-domain#connecting_to_a_domain-joined_linux_vm).\n\nBefore you begin\n----------------\n\n- [Create a Managed Microsoft AD domain](/managed-microsoft-ad/docs/quickstart-create-domain).\n\n- [Create a Linux VM](/compute/docs/create-linux-vm-instance#create_a_virtual_machine_instance).\n When you create the VM, make sure that you complete the following tasks:\n\n - On the **Public images** tab, select the appropriate distribution. For example, **Ubuntu 22.04 LTS** or **Red Hat Enterprise Linux 8**.\n - Select a [Linux version that Managed Microsoft AD\n supports](/managed-microsoft-ad/docs/os-versions#linux-domain-join).\n - Create the VM in the project that hosts your Managed Microsoft AD domain. If your Managed Microsoft AD domain has a [Shared VPC](/vpc/docs/shared-vpc) as an authorized network, you can also create the VM in any of the Shared VPC service projects.\n - Create the VM on a VPC network that you have peered with the Managed Microsoft AD domain.\n- Install `realmd` on the VM. Learn about\n [`realm`](https://www.systutorials.com/docs/linux/man/8-realm/).\n\n See\n [Ubuntu](https://ubuntu.com/server/docs/service-sssd-ad#software-installation-3)\n and [Red\n Hat](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/windows_integration_guide/realmd-prepreqs)\n documentation for instructions.\n\n The following are some sample commands: \n\n ### Ubuntu 22.04 LTS or later\n\n ```\n apt-get update\n apt-get install realmd sssd packagekit\n ```\n\n ### RHEL 8 or later\n\n ```\n sudo yum install realmd oddjob oddjob-mkhomedir\n sssd adcli\n ```\n\nJoin a Linux VM to a domain\n---------------------------\n\nTo join a Linux VM to a domain, you need the following information:\n\n- The domain name of your Managed Microsoft AD domain. For example,\n `mydomain.example.com`.\n\n- The username and password of an account that has permissions to join a VM to\n the domain. By default, members of the `Cloud Service Domain Join Accounts`\n group have these permissions. For more information about the default groups\n that Managed Microsoft AD creates, see\n [Groups](/managed-microsoft-ad/docs/objects#groups).\n\n - The username must be in the following format: \u003cvar translate=\"no\"\u003eUSERNAME\u003c/var\u003e@\u003cvar translate=\"no\"\u003eDOMAIN_NAME\u003c/var\u003e. The domain name part of the username must be in uppercase. For example, `user@MYDOMAIN.EXAMPLE.COM`.\n\nYou can join the Linux VM to the Managed Microsoft AD domain using the\n[`realm\njoin`](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/windows_integration_guide/realmd-domain#realm-join)\ncommand. The following is a sample command: \n\n```\nrealm join DOMAIN_NAME -U 'USERNAME@DOMAIN_NAME'\n```\n\nFor verbose output, add the `-v` flag at the end of the command.\n\n### Specify account location with `realm join`\n\nBy default, the `realm join` command creates a machine account that is located at: \n\n```\nCN=ACCOUNT_NAME,OU=Computers,OU=Cloud,DC=MACHINE,DC=MID_LEVEL,DC=EXTENSION\n```\n\nTo specify where to create the account, use the `--computer-ou` flag to provide\nthe path for the `realm join` command. The following example shows how to\nspecify the path: \n\n```\n--computer-ou=\"OU=CUSTOM_OU,DC=MACHINE,DC=MID_LEVEL,DC=EXTENSION\"\n```\n\nThe user must have the permissions that are required to create accounts in the specified OU.\n\nRemove a Linux VM from a domain\n-------------------------------\n\nTo remove a Linux VM from a domain, you need the domain name of your\nManaged Microsoft AD domain and the username of your user account.\n\nYou can remove a Linux VM from the Managed Microsoft AD domain using the\n[`realm\nleave`](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/windows_integration_guide/realmd-ad-unenroll)\ncommand. The following is a sample command: \n\n```\nrealm leave DOMAIN_NAME -U 'USERNAME@DOMAIN_NAME'\n```\n\nWhat's next\n-----------\n\n- [Connect to a Managed Microsoft AD domain](/managed-microsoft-ad/docs/connect-to-active-directory-domain).\n- Learn about the [delegated administrator account](/managed-microsoft-ad/docs/how-to-use-delegated-admin)."]]