대부분의 경우 OS 로그인을 사용하는 것이 좋습니다. OS 로그인 기능을 사용하면 Compute Engine IAM 역할을 사용하여 Linux 인스턴스에 대한 SSH 액세스를 관리할 수 있습니다. 2단계 인증으로 OS 로그인을 설정하면 추가 보안 레이어를 적용할 수 있으며, 조직 정책 설정으로 조직 수준에서 액세스를 관리할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-18(UTC)"],[[["\u003cp\u003eGoogle Cloud offers several methods to manage user access to Linux VM instances, including OS Login and managing SSH keys in metadata.\u003c/p\u003e\n"],["\u003cp\u003eOS Login is the recommended method for managing user access to Linux VMs, enabling the use of Compute Engine IAM roles and offering enhanced security features like two-factor authentication.\u003c/p\u003e\n"],["\u003cp\u003eManually managing SSH keys in metadata carries risks, such as granting all users with those keys \u003ccode\u003esudo\u003c/code\u003e access and requiring manual tracking of expired or unauthorized keys.\u003c/p\u003e\n"],["\u003cp\u003eApplication access to VM instances can be managed through the use of SSH with service accounts, complementing user access controls.\u003c/p\u003e\n"],["\u003cp\u003eCompute Engine tools can be utilized to manage connections to instances, providing an alternative to manual key management.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nIf you have Linux virtual machine (VM) instances running on Google Cloud, you\nmight need to share or restrict user or application access to your VMs.\n\n- If you need to manage user access to your Linux VM instances, you can use one\n of the following methods:\n\n - [OS Login](#oslogin)\n - [Managing SSH keys in metadata](#ssh-access)\n - [Temporarily grant a user access to an instance](/compute/docs/access/managing-access-to-resources#bind-member)\n- If you need to manage application access to your VM instances, see\n [Use SSH with service accounts](/compute/docs/tutorials/service-account-ssh).\n\n| **Note:** When a user connects to a VM, that user can use all of the IAM permissions granted to the service account attached to the VM.\n\nManaging user access\n\nOS Login\n\nIn most scenarios, we recommend using [OS Login](/compute/docs/oslogin). The OS\nLogin feature lets you use Compute Engine IAM roles to manage\nSSH access to Linux instances. You can add an extra layer of security by\n[setting up OS Login with two-factor authentication](/compute/docs/oslogin/setup-two-factor-authentication),\nand manage access at the organization level by\n[setting up organization policies](/compute/docs/oslogin/manage-oslogin-in-an-org#set-org-policy).\n\nTo learn how to enable OS Login, see\n[Set up OS Login](/compute/docs/instances/managing-instance-access).\n\nManage SSH keys in metadata\n\nIf you are running your own directory service for managing access, or are\notherwise unable to set up OS Login, you can manually manage SSH keys in\nmetadata.\n| **Note:** If you connect to Linux VMs using the Google Cloud console or the Google Cloud CLI, Compute Engine creates SSH keys on your behalf. For more information on how Compute Engine configures and stores keys, see [About SSH connections to Linux VMs](/compute/docs/instances/ssh).\n\nRisks of manual key management\n\nSome of the risks of manual SSH key management include the following:\n\n- All users who connect to VMs using SSH keys stored in metadata have `sudo` access to VMs.\n- You must keep track of expired keys and delete keys for users who shouldn't have access to your VMs. For example, if a team member leaves your project, you must manually remove their keys from metadata, so they can't continue to access your VMs.\n- Specifying your gcloud CLI or API calls incorrectly can potentially wipe out all of the public SSH keys in your project or on your VMs, which disrupts connections for your project members.\n- Users and service accounts that have the ability to modify project metadata can add SSH keys for all VMs in the project except for VMs that [block project-level SSH keys](/compute/docs/connect/restrict-ssh-keys#block-keys).\n\nIf you aren't sure that you want to manage your own keys,\n[use Compute Engine tools to connect to your instances](/compute/docs/instances/connecting-to-instance)\ninstead.\n\nWhat's next?\n\n- Learn how to [set up OS Login](/compute/docs/instances/managing-instance-access).\n- Learn how to [create SSH keys](/compute/docs/connect/create-ssh-keys).\n- Learn how to [add SSH keys to VMs](/compute/docs/connect/add-ssh-keys).\n- Learn how to [restrict SSH keys from VMs](/compute/docs/connect/restrict-ssh-keys)."]]