Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Configurer des clés SSH pour un serveur
Vous pouvez configurer des clés SSH pour votre serveur de solution Bare Metal.
La configuration des clés SSH est facultative. Vous pouvez les définir lorsque vous provisionnez un nouveau serveur ou lorsque vous réinstallez un système d'exploitation sur un serveur existant.
Avant de lancer le processus de provisionnement du serveur, vous devez disposer des clés SSH.
Les clés SSH publiques que vous fournissez sont utilisées comme clés autorisées pour vous connecter à votre serveur de solution Bare Metal.
Vous devez créer la clé Cloud KMS dans le même projet que celui qui contient votre serveur solution Bare Metal.
Si vous choisissez d'utiliser des clés SSH, vous devez disposer d'au moins une clé SSH publique. La clé publique doit avoir une signature de type ssh-rsa :
Dans le projet contenant votre serveur de solution Bare Metal, enregistrez vos clés SSH. Suivez les étapes de la section Enregistrer les clés SSH.
Configurer des clés SSH lors du provisionnement d'un serveur
Vous pouvez configurer des clés SSH pour un nouveau serveur solution Bare Metal lors de son provisionnement à l'aide du formulaire d'ingestion de la console.Google Cloud
Vous ne pouvez sélectionner que les clés SSH qui existent dans le même projet que votre serveur.
SERVER_NAME : nom du serveur de solution Bare Metal.
PROJECT_ID : ID du projet
REGION : emplacement du serveur de solution Bare Metal.
Accéder à un serveur à l'aide des clés SSH
Les clés SSH sont associées à l'utilisateur customeradmin. Par conséquent, lorsque vous vous connectez via SSH, utilisez customeradmin comme nom d'utilisateur.
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)."],[[["\u003cp\u003eSetting up SSH keys for Bare Metal Solution servers is optional and can be done during the provisioning of a new server or while reimaging an existing one.\u003c/p\u003e\n"],["\u003cp\u003eBefore setting up SSH keys, you must create them, ensuring they are of \u003ccode\u003essh-rsa\u003c/code\u003e type, and register them in the same project as your Bare Metal Solution server.\u003c/p\u003e\n"],["\u003cp\u003eSSH keys can be added through the Google Cloud console intake form when provisioning a new server, or during the reimaging process as detailed in the server OS change instructions.\u003c/p\u003e\n"],["\u003cp\u003eYou can view the SSH keys associated with a specific server either through the Google Cloud console's Servers page or using the \u003ccode\u003egcloud alpha bms instances auth-info\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eAccess to the server with SSH keys is managed through the \u003ccode\u003ecustomeradmin\u003c/code\u003e user account.\u003c/p\u003e\n"]]],[],null,["# Set up SSH keys for a server\n============================\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nYou can set up SSH keys for your Bare Metal Solution server.\n\nIt's optional to set up SSH keys. You can set them while provisioning a new\nserver or while reimaging an existing one.\n\nThis feature is available only for the\n[Linux OSes supported by Bare Metal Solution](/bare-metal/docs/bms-planning#linux).\n\nBefore you begin\n----------------\n\n1. Create SSH keys.\n\n Before initiating the server provisioning process, you must have the SSH keys.\n The public SSH keys that you provide are used as the authorized keys to log\n in to your Bare Metal Solution server.\n\n You must create the Cloud KMS key in the same project that contains\n your Bare Metal Solution server.\n\n If you choose to use SSH keys, you need at least one public SSH key. The\n public key must have an `ssh-rsa` type signature: \n\n ssh-rsa \u003cvar translate=\"no\"\u003epublic_key\u003c/var\u003e \u003cvar translate=\"no\"\u003eoptional comment\u003c/var\u003e\n\n To learn how to create SSH keys, see\n [Create SSH keys](/bare-metal/docs/troubleshooting/configure-serial-console#generate-ssh-key).\n\n To learn how to manage your SSH keys, see [Manage SSH keys](/bare-metal/docs/troubleshooting/configure-serial-console#manage-ssh-keys).\n2. In the project that contains your Bare Metal Solution server, register your\n SSH keys. Follow the steps in [Register the SSH keys](/bare-metal/docs/troubleshooting/configure-serial-console#register-ssh-key).\n\nSet up SSH keys while provisioning a server\n-------------------------------------------\n\nYou can set up SSH keys for a new Bare Metal Solution server while provisioning it through the [Google Cloud console intake form](/bare-metal/docs/bms-deploy#use_the_console_intake_form_to_enter_your_selections).\n\nYou can only select the SSH keys that exist in the same project as that of your server.\n\nTo set up SSH keys while provisioning a server, see [Use the Google Cloud console intake form to enter your selections](/bare-metal/docs/bms-deploy#use_the_console_intake_form_to_enter_your_selections).\n\nSet up SSH keys while reimaging a server\n----------------------------------------\n\nTo set up SSH keys while reimaging a server, see [Change the OS for a server](/bare-metal/docs/bms-maintenance#change-os-for-server).\n\nView SSH keys of a server\n-------------------------\n\nTo view SSH keys of a server, follow these steps: \n\n### Console\n\n1. Go to the **Servers** page.\n\n [Go to Servers](https://console.cloud.google.com/compute/bareMetalSolution/servers)\n2. Click the server name.\n\n On the **Server details** page, view the SSH keys in **SSH keys** field.\n\n### gcloud\n\nUse the `gcloud alpha bms instances auth-info` command: \n\n```\ngcloud alpha bms instances auth-info SERVER_NAME --project=PROJECT_ID --region=REGION\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSERVER_NAME\u003c/var\u003e: The name of the Bare Metal Solution server.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: The location of the Bare Metal Solution server.\n\nAccess a server using the SSH keys\n----------------------------------\n\nSSH keys are associated with the `customeradmin` user. Therefore, while logging\nin through SSH, use `customeradmin` as the username.\n\nTo learn how to log in to your Bare Metal Solution server, see\n[Logging in to a Bare Metal Solution server for the first time](/bare-metal/docs/bms-setup#bms-first-logon).\n\nWhat's next\n-----------\n\n- [Operate your Bare Metal Solution server](/bare-metal/docs/bms-maintenance#operate_a_server).\n- [Check the status of a server](/bare-metal/docs/bms-maintenance#check_the_status_of_a_server).\n- [Manage servers](/bare-metal/docs/bms-maintenance#manage_servers)."]]