Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wenn Sie die gcloud CLI installiert haben, können Sie von Ihrem Terminal aus mit Cloud Shell interagieren und es als Sandbox und übertragbare Entwicklungsumgebung verwenden! Dies bietet die Möglichkeit, mit Cloud Shell-Ressourcen zu arbeiten, unabhängig davon, ob Sie einen Vorgang schnell testen oder eine IDE Ihrer Wahl verwenden möchten, um eine auf Ihrer Cloud Shell-Instanz gespeicherte Datei von Ihrem lokalen Computer aus zu bearbeiten.
gcloud cloud-shell verwenden
Das aktuelle gcloud cloud-shell-Befehlsgruppenangebot bietet die folgenden Funktionen:
Eine interaktiven SSH-Sitzung mit Cloud Shell mithilfe von gcloud cloud-shell ssh einrichten.
Kopieren Sie Dateien mithilfe von scp zwischen dem lokalen Computer und der Cloud Shell-Maschine.
Stellen Sie Ihr Cloud Shell-Verzeichnis über sshfs in Ihrem lokalen Dateisystem bereit.
Weitere Informationen finden Sie in der Referenzdokumentation zu gcloud cloud-shell.
Beispielworkflow
Um die Arbeit von gcloud cloud-shell finden Sie hier ein Beispiel dafür, wie diese Befehle in der Praxis funktionieren:
Starten Sie eine SSH-Sitzung:
gcloud cloud-shell ssh
Kopieren Sie die Datei data.txt von Cloud Shell auf Ihren lokalen Computer:
Wenn Sie Mac oder Linux verwenden, können Sie Ihr Cloud Shell-Baisisverzeichnis nach der Installation von sshfs in Ihrem lokalen Dateisystem bereitstellen.
Auf diese Weise können Sie die Dateien in Ihrem Cloud Shell-Basisverzeichnis mit den von Ihnen ausgewählten lokalen Tools bearbeiten. Alle Daten in Ihrem remote bereitgestellten Remotedateisystem werden auf einer Persistent Disk sitzungsübergreifend gespeichert.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-01 (UTC)."],[],[],null,["# Use Cloud Shell with the gcloud CLI\n\nIf you have the [gcloud CLI installed](/sdk/install), you can interact\nwith Cloud Shell from your terminal and use it as a sandbox and a\nportable development environment. This provides the convenience of working\nwith Cloud Shell resources, whether to quickly test an operation\nor use an IDE of your choice to edit a file saved on your\nCloud Shell instance from your local desktop.\n\nUse `gcloud cloud-shell`\n------------------------\n\nThe current `gcloud cloud-shell` command group offering provides the following\nfunctionality:\n\n- Establishing an interactive SSH session with Cloud Shell using [`gcloud cloud-shell ssh`](/sdk/gcloud/reference/cloud-shell/ssh).\n- Copy files between your local and Cloud Shell machine via [scp](/sdk/gcloud/reference/cloud-shell/scp).\n- Mount your Cloud Shell directory to your local file system via [sshfs](/sdk/gcloud/reference/cloud-shell/get-mount-command).\n\nFor more detail, see the reference documentation for\n[`gcloud cloud-shell`](/sdk/gcloud/reference/cloud-shell).\n| **Note:** To propagate your credentials to your Cloud Shell when starting it from the Google Cloud CLI, use the [`--authorize-session`](/sdk/gcloud/reference/cloud-shell/ssh#--authorize-session) flag when running the `gcloud cloud-shell ssh` command.\n\nExample workflow\n----------------\n\nTo illustrate the workings of `gcloud cloud-shell`, here is an example of how\nyou can use these commands in practice:\n\n1. Start a SSH session:\n\n gcloud cloud-shell ssh\n\n2. Copy a file, `data.txt`, from Cloud Shell to your local machine:\n\n gcloud cloud-shell scp cloudshell:~/data.txt localhost:~data.txt\n\n3. If you're using Mac or Linux, you can mount your Cloud Shell home\n directory onto your local file system after installing\n [sshfs](https://github.com/libfuse/sshfs).\n\n This allows you to edit the files in your Cloud Shell home directory using\n your choice of local tools. All the data in your remotely mounted file\n system is stored on a [Persistent Disk](/persistent-disk)\n and stored across sessions. \n\n gcloud cloud-shell get-mount-command ~/my-cloud-shell"]]