Skip to content

Can we have an option that we can sudo without password? #16

@haohaolee

Description

@haohaolee

Hi Hi,
Wish you are doing good. While I think this devcontainer feature create-remote-user is very useful, sometimes I need run some scripts before we enter the container. e.g.:

"postStartCommand": "sudo bash $(pwd)/.devcontainer/dev-setup.sh",

because sudo still needs a password here, so the process is blocked.

I am wondering if we can have a new option like runSudoWithoutPassword with a default false, when true, it does something like

echo $_REMOTE_USER ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$_REMOTE_USER
chmod 0440 /etc/sudoers.d/$_REMOTE_USER

instead of adding the user to sudo group.

What do you think?

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions