이 페이지에서는 OS 로그인 서비스 및 사용 방법에 대해 설명합니다. OS 로그인 설정 방법은 OS 로그인 설정을 참조하세요.
개별 SSH 키를 생성하고 관리할 필요 없이 OS 로그인을 사용하여 IAM으로 인스턴스에 대한 SSH 액세스를 관리하세요. OS 로그인은 VM 인스턴스에서 일관된 Linux 사용자 ID를 유지하며, 여러 VM 또는 프로젝트에서 많은 사용자를 관리하는 데 권장되는 방법입니다.
OS 로그인의 이점
OS 로그인을 사용하면 Linux 사용자 계정을 Google ID에 연결하여 SSH 액세스 관리를 간소화할 수 있습니다. 관리자는 IAM 권한을 설정하여 인스턴스 또는 프로젝트 수준에서 인스턴스에 대한 액세스를 쉽게 관리할 수 있습니다.
OS 로그인은 다음과 같은 이점을 제공합니다.
Linux 계정 수명 주기 자동 관리 - Linux 사용자 계정을 사용자의 Google ID에 직접 연결할 수 있으므로 같은 프로젝트 또는 조직의 모든 인스턴스에서 동일한 Linux 계정 정보가 사용됩니다.
Google IAM을 사용한 세부 승인 - 프로젝트 및 인스턴스 수준의 관리자는 더 광범위한 권한 조합을 부여하지 않고도 IAM을 사용하여 사용자의 Google ID에 SSH 액세스 권한을 부여할 수 있습니다. 예를 들어 사용자에게 시스템에 로그인할 수 있는 권한은 부여하고 sudo와 같은 명령어를 실행할 수 있는 권한은 부여하지 않을 수 있습니다. Google에서는 이러한 권한을 확인하여 사용자가 VM 인스턴스에 로그인할 수 있는지 여부를 결정합니다.
권한 자동 업데이트 - OS 로그인을 사용하면 관리자가 IAM 권한을 변경할 때 사용 권한이 자동으로 업데이트됩니다. 예를 들어 Google ID에서 IAM 권한을 삭제하면 VM 인스턴스에 대한 액세스 권한이 취소됩니다. Google에서는 무단 액세스를 방지하기 위해 모든 로그인 시도에 대해 권한을 확인합니다.
기존 Linux 계정을 가져오는 기능 - 관리자는 온프레미스에 설정된 AD(Active Directory) 및 LDAP(Lightweight Directory Access Protocol)의 Linux 계정 정보를 동기화하도록 선택할 수 있습니다. 예를 들어 사용자가 클라우드 환경과 온프레미스 환경 모두에서 동일한 사용자 ID(UID)를 사용하도록 할 수 있습니다.
Google 계정 2단계 인증 통합 - OS 로그인 사용자가 VM에 연결할 때 다음 2단계 인증(2FA) 방법이나 본인 확인 유형 중 하나를 사용하여 ID의 유효성을 검사하도록 선택적으로 요구할 수 있습니다.
인증서 기반 인증 지원(프리뷰) - SSH 인증서 인증을 사용하여 OS 로그인을 사용하는 VM에 연결할 수 있습니다. 자세한 내용은 OS 로그인에 SSH 인증서 요구를 참조하세요.
감사 로깅과 통합 - OS 로그인은 OS 로그인 사용자의 VM 연결을 모니터링하는 데 사용할 수 있는 감사 로깅을 제공합니다.
OS 로그인 사용 방법
OS 로그인이 사용 설정되면 Compute Engine이 VM 및 OS 로그인 사용자의 Google 계정에 대해 구성을 수행합니다.
VM 구성
OS 로그인을 사용 설정하면 Compute Engine이 VM의 authorized_keys 파일을 삭제하고 OpenSSH 서버를 구성합니다. 이 서버는 로그인 시도를 인증하기 위해 Linux 사용자 계정과 연결된 SSH 키를 검색합니다.
authorized_keys 파일을 구성하여 OS 로그인이 사용 설정된 경우에도 로컬 사용자 계정에 대한 액세스를 프로비저닝할 수 있습니다. authorized_keys 파일에 구성된 SSH 공개 키는 로컬 사용자의 사용자 로그인 시도를 인증하는 데 사용됩니다. 로컬 사용자 계정의 사용자 이름과 UID는 OS 로그인 사용자와 달라야 합니다.
OS 로그인은 사용자가 다음을 수행할 때 사용자 이름을 포함해서 POSIX 정보를 사용하여 사용자의 Google 계정을 구성합니다.
Google Cloud 콘솔을 사용하여 OS 로그인 지원 VM에 연결
gcloud CLI를 사용하여 OS 로그인 지원 VM에 연결
gcloud CLI를 사용하여 공개 SSH 키 가져오기
OS Login API를 사용하여 공개 SSH 키 가져오기
OS 로그인은 다음 값을 사용해서 POSIX 계정을 구성합니다.
사용자 이름:USERNAME_DOMAIN_SUFFIX 형식의 사용자 이름입니다.
사용자가 OS 로그인 지원 VM을 호스팅하는 조직이 아닌 다른 Google Workspace 조직에서 온 경우, 해당 사용자 이름에 ext_가 프리픽스로 표시됩니다. 사용자가 서비스 계정이면 해당 사용자 이름에 sa_가 프리픽스로 표시됩니다.
Cloud ID 관리자는 사용자 이름을 수정할 수 있고 Google Workspace 최고 관리자는 사용자 이름 형식을 변경하여 도메인 서픽스를 삭제할 수 있습니다.
[[["이해하기 쉬움","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-07-31(UTC)"],[[["\u003cp\u003eOS Login streamlines SSH access management by linking Linux user accounts to Google identities, eliminating the need for individual SSH key management.\u003c/p\u003e\n"],["\u003cp\u003eIt leverages Google IAM for fine-grained authorization, enabling administrators to control access at the instance or project level and grant specific permissions, such as login without \u003ccode\u003esudo\u003c/code\u003e rights.\u003c/p\u003e\n"],["\u003cp\u003eOS Login automates Linux account lifecycle management, ensuring consistent user information across VMs, and automatically updates permissions based on changes in IAM settings.\u003c/p\u003e\n"],["\u003cp\u003eThe system supports integration with two-step verification methods and provides audit logging for monitoring VM connections.\u003c/p\u003e\n"],["\u003cp\u003eWhen OS Login is enabled, it configures VMs by managing \u003ccode\u003eauthorized_keys\u003c/code\u003e files, setting up an OpenSSH server with \u003ccode\u003eAuthorizedKeysCommand\u003c/code\u003e, configuring NSS functionality, and adding PAM configurations.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nThis page describes the OS Login service and how it works. To learn how to set\nup OS Login, see [Set up OS Login](/compute/docs/oslogin/set-up-oslogin).\n\nUse OS Login to manage SSH access to your instances using IAM\nwithout having to create and manage individual SSH keys. OS Login maintains a\nconsistent Linux user identity across VM instances and is the recommended way to\nmanage many users across multiple VMs or projects.\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\nBenefits of OS Login\n\nOS Login simplifies SSH access management by linking your Linux user account to\nyour Google identity. Administrators can easily manage access to instances at\neither an instance or project level by setting IAM permissions.\n\nOS Login provides the following benefits:\n\n- **Automatic Linux account lifecycle management** - You can directly tie\n a Linux user account to a user's Google identity so that the same Linux\n account information is used across all instances in the same project or\n organization.\n\n- **Fine grained authorization using Google IAM** - Project\n and instance-level administrators can use IAM to grant SSH\n access to a user's Google identity without granting a broader set of\n privileges. For example, you can grant a user permissions to log into the\n system, but not the ability to run commands such as `sudo`. Google checks\n these permissions to determine whether a user can log into a VM instance.\n\n- **Automatic permission updates** - With OS Login, permissions are updated\n automatically when an administrator changes IAM\n permissions. For example, if you remove IAM permissions from\n a Google identity, then access to VM instances is revoked. Google checks\n permissions for every login attempt to prevent unwanted access.\n\n- **Ability to import existing Linux accounts** - Administrators\n can choose to optionally synchronize Linux account information from\n Active Directory (AD) and Lightweight Directory Access Protocol (LDAP) that\n are set up on-premises. For example, you can ensure that users have the\n same user ID (UID) in both your Cloud and on-premises environments.\n\n- **Integration with Google Account two-step verification** - You can optionally\n require that OS Login users validate their identity using one of the following\n 2-step verification (2FA) methods or challenge types when connecting to VMs:\n\n - [Google Authenticator](https://support.google.com/accounts/answer/1066447)\n - Text message or phone call verification\n - [Phone prompts](https://support.google.com/accounts/answer/7026266)\n - [Security key one-time password (OTP)](https://gsuiteupdates.googleblog.com/2019/06/security-codes-and-security-keys.html)\n- **Support for certificate-based authentication (Preview)** - You can use SSH\n certificate authentication to connect to VMs that use OS Login. For more\n information, see\n [Require SSH certificates with OS Login](/compute/docs/oslogin/certificates).\n\n- **Integration with audit logging** - OS Login provides\n [audit logging](/compute/docs/oslogin/view-audit-logs) that you can use to\n monitor connections to VMs for OS Login users.\n\nHow OS Login works\n\nWhen OS Login is enabled, Compute Engine performs configurations\non VMs and the Google accounts of OS Login users.\n\nVM configuration\n\nWhen you enable OS Login, Compute Engine deletes the VM's `authorized_keys`\nfiles and configures an OpenSSH server. This server retrieves the SSH keys\nassociated with the Linux user account to authenticate the login attempt.\n\nYou can configure an `authorized_keys` file to provision access for a local user\naccount even when OS Login is enabled. SSH public keys that are configured in\nthe `authorized_keys` file are used to authenticate user login attempts by the\nlocal user. Local user accounts and OS Login users must have different usernames\nand UIDs.\n| **Note:** VMs that use OS Login can't use metadata-based SSH keys. If you enable OS Login for a VM, then the VM's guest agent ignores the keys stored in metadata. To learn more about using SSH keys with VMs, see [Add SSH keys to VMs](/compute/docs/connect/add-ssh-keys).\n\nFor more information about the OS Login components, review the\n[OS Login GitHub page](https://github.com/GoogleCloudPlatform/guest-oslogin#overview).\n\nUser account configuration\n\nOS Login configures your Google account with POSIX information, including a\nusername, when you do any of the following:\n\n- Connect to an OS Login-enabled VM using the Google Cloud console\n- Connect to an OS Login-enabled VM using the gcloud CLI\n- Import a public SSH key using the gcloud CLI\n- Import a public SSH key using the OS Login API\n\nOS Login configures POSIX accounts with the following values:\n\n- **Username:** a username in the format of\n \u003cvar translate=\"no\"\u003eUSERNAME\u003c/var\u003e`_`\u003cvar translate=\"no\"\u003eDOMAIN\u003c/var\u003e`_`\u003cvar translate=\"no\"\u003eSUFFIX\u003c/var\u003e.\n If the user is from a different Google Workspace organization than the\n one hosting their OS Login-enabled VMs, their username is prefixed\n with `ext_`. If the user is a service account, its username is prefixed with\n `sa_`.\n\n Cloud Identity administrators can\n [modify usernames](/compute/docs/oslogin/manage-oslogin-in-an-org#modify-users)\n and Google Workspace super administrators can change the username\n format to\n [remove the domain suffix](/compute/docs/oslogin/manage-oslogin-in-an-org#manage-oslogin-api).\n- **UID:** a unique, randomly-generated\n [POSIX-compliant](https://en.wikipedia.org/wiki/User_identifier) user ID.\n\n- **GID:** a POSIX-compliant group ID that is the same as the UID.\n\n- **Home directory:** the path to the user's home directory.\n\nOrganization administrators can configure and update a user's POSIX account\ninformation. For more information, see\n[Modify user accounts using the Directory API](/compute/docs/oslogin/manage-oslogin-in-an-org#modify-users).\n\nWhat's next\n\n- For step-by-step instructions, review one of the following:\n - [Setting up OS Login](/compute/docs/instances/managing-instance-access).\n - [Setting up OS Login with 2-step verification](/compute/docs/oslogin/setup-two-factor-authentication)\n- Review [Managing OS Login in an organization](/compute/docs/oslogin/manage-oslogin-in-an-org)\n- [Troubleshoot](/compute/docs/oslogin/troubleshoot-os-login) OS Login."]]