[BUG] --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons

Status Fixed / completed
Maintainer reply None cached
Activity 15 comments · opened Oct 8, 2025 · closed Mar 9, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When I try to run --dangerously-skip-permissions I get the error cannot be used with root/sudo privileges for security reasons

What Should Happen?

Claude Code should run as I choose it to run. If I choose to sandbox I'm taking my own safety into my own hands.

Error Messages/Logs

--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons

Steps to Reproduce

  1. Install Claude Code
  2. Run claude --dangerously-skip-permissions with a root account
  3. enjoy Claude being obtuse and refusing to start.

This is an ignorant change. Revert this or allow us a parameter to override. I run CC sandboxed, my risk is my business. This is the last straw before I permanently move the team to Codex.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.10

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Warp

Additional Information

_No response_

View original on GitHub ↗

15 Comments

github-actions[bot] · 10 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/3490
  2. https://github.com/anthropics/claude-code/issues/927

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

omayhemo · 10 months ago

I've seen the work arounds in those is_sandbox=1 claude --dangerously-skip-permissions, but it doesn't work. While claude will run with this parameter, it still asks for permissions constantly, which is useless to me. DO NOT CLOSE THIS TICKET UNTIL FIXED.

travissavard · 10 months ago

@omayhemo Try
su node
claude --dangerously-skip-permissions

sammrai · 9 months ago

@omayhemo
FYI.

IS_SANDBOX=1 claude --dangerously-skip-permissions
works fine for me.

Orlando-Richards · 8 months ago

Add:

        {
            "name": "IS_SANDBOX",
            "value": "1"
        }

To claudeCode.environmentVariables if using the plugin.

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

dlukt · 6 months ago

ARGH! I need --dangerously-skip-permissions as root. How do I bypass this crap?

NM reading helps

rgaufman · 6 months ago

IS_SANDBOX=1 claude --dangerously-skip-permissions

Linwei-Chen · 6 months ago
@omayhemo FYI.  供参考。 IS_SANDBOX=1 claude --dangerously-skip-permissions works fine for me.对我来说没问题。

This solve the problem.

david-wolgemuth · 6 months ago

should simply add to message,

--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons. > if you are in a sandboxed environment and which to ignore this warning, add IS_SANDBOX=1 to environment
xuanswe · 6 months ago

If I run directly IS_SANDBOX=1 claude --dangerously-skip-permissions, it works.

But I don't want to always type this long command in my safe container. I want it is default and I only need to start with claude.

So, I set the environment variable IS_SANDBOX to 1 globally, and having /root/.claude/settings.json:

{
  "skipDangerousModePermissionPrompt": true,
  "permissions": {
    "defaultMode": "bypassPermissions"
  }
}

Unfortunately, I got this error:

root ➜ /project $ claude
Welcome to Claude Code v2.1.63

 Unable to connect to Anthropic services

 Failed to connect to platform.claude.com: ERR_BAD_RESPONSE

 Please check your internet connection and network settings.

 Note: Claude Code might not be available in your country. Check supported countries at https://anthropic.com/supported-countries
Linwei-Chen · 6 months ago
If I run directly IS_SANDBOX=1 claude --dangerously-skip-permissions, it works.如果我直接运行 IS_SANDBOX=1 claude --dangerously-skip-permissions ,它就能运行。 But I don't want to always type this long command in my safe container. I want it is default and I only need to start with claude.但我不想每次都在安全容器里输入这么长的命令。我希望它是默认设置,我只需要以 claude 开头即可。 So, I set the environment variable IS_SANDBOX to 1 globally, and having /root/.claude/settings.json:因此,我将全局环境变量 IS_SANDBOX 设置为 1 ,并且 /root/.claude/settings.json 文件内容如下: `` { "skipDangerousModePermissionPrompt": true, "permissions": { "defaultMode": "bypassPermissions" } } ` Unfortunately, I got this error:很遗憾,我遇到了这个错误: ` root ➜ /project $ claude Welcome to Claude Code v2.1.63 Unable to connect to Anthropic services Failed to connect to platform.claude.com: ERR_BAD_RESPONSE Please check your internet connection and network settings. Note: Claude Code might not be available in your country. Check supported countries at https://anthropic.com/supported-countries ``

Easy, add an alias, like ccglmskip = IS_SANDBOX=1 start-claude ccglmskip, to your bashrc

xuanswe · 6 months ago

oh, wait. When I access https://claude.ai/oauth/authorize ... I see Claude is currently experiencing a temporary service disruption.
So, maybe it is just coincident. I will wait until the service is stable and try again.

xuanswe · 6 months ago
So, I set the environment variable IS_SANDBOX to 1 globally, and having /root/.claude/settings.json: `` { "skipDangerousModePermissionPrompt": true, "permissions": { "defaultMode": "bypassPermissions" } } ``

It works, everybody! The error I reported was just a coincident of unstable claude server side.

With the configuration above, life is easy now.

root ➜ /project $ echo $IS_SANDBOX 
1
root ➜ /project $ claude

╭─── Claude Code v2.1.63 

─────────────────
❯  
─────────────────
⏵⏵ bypass permissions on (shift+tab to cycle)
github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.