# Disable or reset Cloud Shell

Cloud Shell lets you turn off access for managed users to help maintain
security and control development environments across your organization. If you
encounter configuration issues or corrupted files, you can reset your
Cloud Shell instance to reprovision a clean home directory and restore
default settings.

## Disable Cloud Shell for managed user accounts

To disable Cloud Shell for
[Google Workspace](https://support.google.com/a/answer/4352075) and
[Cloud Identity](https://support.google.com/a/answer/7319251)
managed user accounts, go to the
Google Admin console and then navigate to
**Apps** \> **Additional Google services** \> **Google Cloud Platform** \>
**Cloud Shell Settings**
and disable **Cloud Shell Access Settings**.

To disable Cloud Shell for specific users, you'll need to use access
groups: add individual users to the group and turn off the group's
Cloud Shell access setting. For more information, see
[Controlling who uses Google Cloud in your organization guide](https://support.google.com/a/answer/9197205).

## Reset Cloud Shell

> [!WARNING]
> **Warning:** Resetting Cloud Shell permanently deletes all files in your persistent `$HOME` directory, including personal code, git repositories, SSH keys, credentials, and custom configurations.

If you are experiencing issues with Cloud Shell, review
[Cloud Shell troubleshooting](https://docs.cloud.google.com/shell/docs/troubleshooting.md.txt#unresponsive)
before resetting.

To reset Cloud Shell and restore your Cloud Shell home
directory to a clean, default state:

1. Check for personal files in the home directory and note that the next step
   deletes these files:

   ```sh
   ls -a $HOME
   ```

   If you want to back up any of the listed files before they're permanently
   deleted as part of the reset, copy them to a destination outside of
   Cloud Shell, such as by
   [downloading the files](https://docs.cloud.google.com/shell/docs/uploading-and-downloading-files.md.txt) to
   your local machine.
2. Permanently remove all files from your home directory:

   ```sh
   sudo rm -rf $HOME
   ```
3. In the Cloud Shell menu, click
   **More**.

4. Click **Restart**.

5. If prompted, click **Restart** in the confirmation dialog.

   This provisions a new VM and restores the home directory to its default state.