ovh/the-bastion

sudo: a password is required

thannaske opened this issue · 3 comments

I've installed the bastion on a standard minimal Ubuntu 20.04 by following the installation instructions and created an account that is a superowner, admin and auditor (My user is in the config file as well as in the system groups).

However, when trying to execute restricted commands, like adminSudo or accountGrantCommand I run into the issue that the command fails with the error sudo: a password is required.

~ <1629559:/opt/the-bastion-3.08.01/bin/plugin/restricted/accountGrantCommand> about to run_cmd ['sudo','-n','-u','root','--','/usr/bin/env','perl','-T','/opt/the-bastion-3.08.01/bin/helper/osh-accountModifyCommand','--action','grant','--command','adminSudo','--account','thannaske']
~ <1629559:/opt/the-bastion-3.08.01/bin/plugin/restricted/accountGrantCommand> waiting for child PID 1629560 to complete...
sudo: a password is required

Do you have any idea why this happens and how I can fix this issue?

Hello,

Yes, this is because apparently your installation has been done under /opt/the-bastion-3.08.01 instead of /opt/bastion.
As sudoers templates point to /opt/bastion, this doesn't match your installation and commands under sudo are refused.
Moving /opt/the-bastion-3.08.01 to/opt/bastion should fix your problem.

Out of curiosity, did you install it there on purpose? If not, then we might have to fix something in the documentation!

Thanks, you are a lifesaver! Simple yet major mistake from my side. I downloaded the tarball and softlinked it to /opt/bastion which the resulted in the sudo issues.

Glad to hear this fixed your issue!