Prevent users from running shell commands

bvraravind
New Contributor II

Hi, is there any way to prevent users from running shell commands in Databricks notebooks? for example, "%%bash" 

I read that REVOKE EXECUTE ON SHELL command can be used. but i am unable to make it to work. Thanks in advance for any help.

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @bvraravind,

You can use this spark setting 

"spark_conf.spark.databricks.repl.allowedLanguages": { "type": "fixed", "value": "python,sql"

Over a cluster policy to prevent access to shell commands.

https://docs.databricks.com/en/archive/compute/cluster-ui-preview.html