Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create net_namespace failed: Operation not permitted #3

Closed
wholenewx opened this issue Sep 18, 2023 · 2 comments
Closed

create net_namespace failed: Operation not permitted #3

wholenewx opened this issue Sep 18, 2023 · 2 comments

Comments

@wholenewx
Copy link

wholenewx commented Sep 18, 2023

Hello nlzy

I use nsproxy in a debian 10 and when I exec ./nsproxy -x xxx -x xxx ... , it shows :

nsproxy: create net_namespace failed: Operation not permitted
nsproxy: nsproxy can't run on this system.
The OS is debian 10

uname -r
4.19.0-25-amd64

Is there a dependency missing? Please help me, thanks

@nlzy
Copy link
Owner

nlzy commented Sep 18, 2023

Hi,

Unprivileged user-namespace is disabled by defualt on Debian 10.

Use this command to enable it, then nsproxy should work:

sudo sysctl -w kernel.unprivileged_userns_clone=1

This setting will be discarded on next reboot, use this command to save permanently:

echo 'kernel.unprivileged_userns_clone=1' | sudo tee /etc/sysctl.d/00-local-userns.conf

Or consider upgrading your OS to Debian 11+, which enable this feature by default, see
https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html#linux-user-namespaces

@wholenewx
Copy link
Author

wholenewx commented Sep 18, 2023

Hi nlzy

Thanks a lot!

I had updated the kernel of Debian 10 from 4.19 to 5.10 and now nsproxy works good.

Next time, with your advice, no kernel update is needed, it's more convenient.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants