참고: Cloud Shell을 사용하여 명령어를 실행하는 경우 IPv4를 사용하여 연결하려면 SSH 플래그에 -4를 추가합니다. 예를 들면 다음과 같습니다.
---4-LLOCAL_PORT:localhost:REMOTE_PORT
로컬 브라우저를 통해 JupyterLab 세션에 액세스합니다.
로컬 머신에서 명령어를 실행한 경우 https://localhost:8080을 방문하여 JupyterLab에 액세스합니다.
Cloud Shell을 사용하여 명령어를 실행한 경우 포트 8080에서 웹 미리보기를 통해 JupyterLab에 액세스합니다.
SSH를 사용하여 인스턴스에 액세스해야 하는 이유
JupyterLab에 대한 HTTPS 액세스 권한을 얻으려면 Vertex AI Workbench 인스턴스가 Google Cloud 프록시 서비스에 액세스할 수 있어야 합니다.
인스턴스는 시작될 때 프록시 서비스에 등록하려고 시도합니다. 프록시 액세스 권한을 가져올 수 없으면 인스턴스에 SSH를 통해 JupyterLab에 액세스하라는 메시지가 표시됩니다.
다음은 JupyterLab에 대한 HTTPS 액세스 권한이 없을 수 있는 일반적인 이유입니다.
JupyterLab 인스턴스의 프록시 모드 메타데이터 설정이 잘못됨
JupyterLab 노트북을 실행하는 가상 머신(VMs)의 인터넷 액세스를 차단하도록 네트워크가 구성되어 있음
메타데이터 섹션에서 메타데이터를 추가하거나 수정하여 프록시 모드 항목이 올바른 값으로 설정되어 있는지 확인합니다(예: project_editors).
저장을 클릭합니다.
네트워크가 인터넷 액세스를 차단하고 있습니다
JupyterLab 인스턴스는 공개 URL을 통해 프록시 서비스에 액세스합니다.
Virtual Private Cloud 네트워크 설정이 공개 인터넷에 대한 액세스를 차단하거나 방화벽 규칙이 이그레스 트래픽을 차단하는 경우 SSH를 사용하여 Vertex AI Workbench 인스턴스에 액세스해야 합니다.
가능하다면 네트워크 및 방화벽 관리자와 협력하여 공개 인터넷을 통한 인스턴스에 대한 액세스를 허용하는 것이 좋습니다.
인스턴스에 외부 IP 주소가 없음
외부 IP 주소 없이 Vertex AI Workbench 인스턴스를 만들었을 수 있습니다. 이를 변경해야 하는 경우 다음 단계를 완료하세요.
[[["이해하기 쉬움","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-29(UTC)"],[],[],null,["# Use SSH to access JupyterLab\n============================\n\nThis guide describes how to access your Vertex AI Workbench instance's\nJupyterLab user interface by using SSH port forwarding.\n\nSet up SSH port forwarding and access the JupyterLab user interface\n-------------------------------------------------------------------\n\nTo set up\n[SSH port forwarding](/solutions/connecting-securely#port-forwarding-over-ssh),\ncomplete the following steps, and then access your JupyterLab session through a\nlocal browser:\n\n1. Run the following command by using the [Google Cloud CLI](/sdk/gcloud) in\n your preferred terminal or in\n [Cloud Shell](https://console.cloud.google.com?cloudshell=true):\n\n ```bash\n gcloud compute ssh \\\n --project PROJECT_ID \\\n --zone ZONE \\\n INSTANCE_NAME \\\n -- -L 8080:localhost:8080\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your [Google Cloud project ID](/resource-manager/docs/creating-managing-projects#identifying_projects)\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the [zone](/compute/docs/regions-zones) where your instance is located\n - \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e: the name of your instance\n\n If using Cloud Shell to run the command, add a `-4` to\n the SSH flags to use IPv4 to connect. For example: \n\n ```bash\n -- -4 -L LOCAL_PORT:localhost:REMOTE_PORT\n ```\n2. Access your JupyterLab session through a local browser:\n\n - If you ran the command on your local machine, visit\n `https://localhost:8080` to access JupyterLab.\n\n - If you ran the command using\n [Cloud Shell](https://console.cloud.google.com?cloudshell=true),\n access JupyterLab through the\n Web\n Preview on port 8080.\n\nWhy you might need to access your instance by using SSH\n-------------------------------------------------------\n\nTo get HTTPS access to JupyterLab, your Vertex AI Workbench\ninstance must have access to a Google Cloud proxy service.\nWhen the instance starts, it attempts to register itself with\nthe proxy service. If it fails to get proxy access,\nyour instance prompts you to access JupyterLab through SSH.\n\nThe following are common reasons why you might not have HTTPS access to\nJupyterLab:\n\n- Your JupyterLab instance's proxy-mode metadata setting\n is incorrect.\n\n- Your network is configured to block internet access for the\n virtual machines (VMs) running JupyterLab notebooks.\n\n- Your instance doesn't have an external IP address.\n\n- Your [VPC Service Controls](/vpc-service-controls/docs/overview) settings\n block access to [Artifact Registry](/artifact-registry/docs/overview).\n\nThe following sections show how to resolve these issues.\n\nFor changes to take effect, you might need to restart the notebook's VM when\nattempting to resolve these issues.\n\nYour JupyterLab instance's proxy-mode metadata setting is incorrect\n-------------------------------------------------------------------\n\nBy default, when you create a Vertex AI Workbench instance,\nVertex AI Workbench adds the proxy-mode metadata setting.\nIf you change or remove the proxy-mode metadata setting, then\nthe instance can't connect to the proxy service.\n\nTo add or modify the metadata to ensure there's a proxy-mode entry set\nto the correct value (for example: `project_editors`), use the\n[`projects.locations.instances.patch`](/vertex-ai/docs/workbench/reference/rest/v2/projects.locations.instances/patch)\nmethod in the Notebooks API or the\n[`gcloud workbench instances update`](/sdk/gcloud/reference/workbench/instances/update)\ncommand in the Google Cloud SDK.\n\nThe network is blocking internet access\n---------------------------------------\n\nYour JupyterLab instance accesses the proxy service through a public URL.\nIf your Virtual Private Cloud network settings block access to the public internet\nor your firewall rules block egress traffic, you must use SSH to access\nyour Vertex AI Workbench instance.\nIf possible, you might want to work\nwith your network and firewall administrators to allow access to your\ninstance through the public internet.\n\nYour instance doesn't have an external IP address\n-------------------------------------------------\n\nYou might have created your Vertex AI Workbench instance\nwithout an external IP address. If you need to change this,\ncomplete the following steps.\n\n1. In the Google Cloud console, go to the **Instances** page.\n\n [Go to Instances](https://console.cloud.google.com/vertex-ai/workbench/instances)\n2. Click the name of the instance that you need to modify.\n\n3. Click **View VM details**.\n\n4. Click **Edit**.\n\n5. In the **Network interfaces** section, expand the network that\n you want to have an external IP address.\n\n6. Click the **External IP address** drop-down menu,\n and select the option that you want.\n To resolve this issue, you must not choose **None**.\n\n7. In the **Network interfaces** section, click **Done**.\n\n8. Click **Save**.\n\nVPC Service Controls settings are blocking access to Artifact Registry\n----------------------------------------------------------------------\n\nTo connect to the proxy service,\nyour Vertex AI Workbench instance runs an\nagent that it downloads from Artifact Registry. Without this agent\nyour instance cannot connect to the proxy service.\n\nIf your VPC Service Controls settings are blocking access to\nArtifact Registry, you must add the Artifact Registry\nservice to the service perimeter of your VPC Service Controls.\n[Learn more about how service perimeters\nwork and what services VPC Service Controls can be used\nto secure](/vpc-service-controls/docs/overview#capabilities).\n\nFurther troubleshooting\n-----------------------\n\nIf you are still having trouble connecting, try reviewing the console\nlogs for your virtual machine. These logs might help you discover why\nthe Vertex AI Workbench instance is unable\nto register with the proxy service.\n\nTo access these logs, complete the following steps:\n\n1. In the Google Cloud console, go to the **Instances** page.\n\n [Go to Instances](https://console.cloud.google.com/vertex-ai/workbench/instances)\n2. Select the instance that you want to troubleshoot.\n\n3. In **Logs** , click **Serial port 1 (console)**.\n\nWhat's next\n-----------\n\nFor tips on resolving other issues,\nsee the [troubleshooting section on\nVertex AI Workbench instances](/vertex-ai/docs/general/troubleshooting-workbench#instances)."]]