This has been reported already in this issue on containers/toolbox but it seems like it should be fixed in the fedora-toolbox image instead.
To summarize:
[USER@HOST ~]$ toolbox enter
⬢[USER@toolbox ~]$ sudo -n whoami
sudo: a password is required
⬢[USER@toolbox ~]$ sudo whoami
root
⬢[USER@toolbox ~]$ sudo -n whoami
root
Running sudo -n /any/command/you/like
inside the default fedora-toolbox image fails with sudo: a password is required
.
This can be worked around by running sudo /any/command/you/like
, and then running sudo -n /any/command/you/like
(with -n
)
This can also worked around more permanently by configuring sudo to not require a password inside the toolbox: echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/nopasswd
I ran into this while running an Ansible playbook locally inside a Toolbox container (for applying dotfiles). I initially used the sudo whoami
workaround, but that didn’t allow me to run the playbook with a systemd timer.
I am sorry if this isn’t the place for bug reports, but if i understand correctly, bugzilla is being phased out. If there is a better place to report this, please point me in the right direction.