Skip to content

How to run sudo command inside Singularity container if I am not a sudo user in host? #2548

Answered by dtrudg
Heng-Zhou asked this question in Q&A
Discussion options

You must be logged in to vote

Escalating privilege (i.e. becoming root or another user with sudo) inside a container is blocked by default. This is by design, and is one of the core differences with Docker that enabled Singularity to be safely used, and become popular on HPC systems -
where it is vital that a user who runs a container is not able to get root access on the host.

https://docs.sylabs.io/guides/4.0/user-guide/security.html#runtime-user-privilege-model

In newer Linux distributions than were available when Singularity was first developed, the Linux kernel provides features that allow you to emulate root inside a container. You can act as root in the container, without having any root privileges on the host …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dtrudg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants