Disable or reset Cloud Shell

Cloud Shell can be disabled for managed user accounts. You can restore your Cloud Shell home directory to a clean state.

Disable Cloud Shell for managed user accounts

Cloud Shell can be disabled for G Suite and Cloud Identity managed user accounts. This can be done by going to the Google Admin console and then navigating to Apps > Additional Google services > Google Cloud Platform > Cloud Shell Settings and disabling "Cloud Shell Access Settings".

To disable Cloud Shell for specific users, you'll need to use access groups, adding the individual users to the group and turning off the group's Cloud Shell access setting. Refer to the Controlling who uses Google Cloud in your organization guide for detailed instructions.

Reset Cloud Shell

To restore your Cloud Shell home directory to a clean state:

  1. Check for personal files in the home directory:

    ls -a $HOME
    
  2. Remove all files from your home directory:

    sudo rm -rf $HOME
    
  3. In the Cloud Shell menu, click More > Restart.

    Click Restart in the confirmation dialog.

    A new VM is provisioned and the home directory is restored to its default state.