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 and Cloud Identity 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.
Reset Cloud Shell
To reset Cloud Shell and restore your Cloud Shell home directory to a clean state, follow these steps.
To restore your Cloud Shell home directory to a clean state:
Check for personal files in the home directory and note that the next step deletes these files:
ls -a $HOME
Remove all files from your home directory:
sudo rm -rf $HOME
In the Cloud Shell menu, click More and then click Restart. If prompted, click Restart in the confirmation dialog.
This provisions a new VM and restores the home directory to its default state.