[GH-ISSUE #324] sudo: a password is required #79

Closed
opened 2026-05-07 00:18:30 +02:00 by BreizhHardware · 3 comments

Originally created by @thannaske on GitHub (Jul 8, 2022).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/324

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?

Originally created by @thannaske on GitHub (Jul 8, 2022). Original GitHub issue: https://github.com/ovh/the-bastion/issues/324 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?
Author
Owner

@speed47 commented on GitHub (Jul 8, 2022):

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!

<!-- gh-comment-id:1179038852 --> @speed47 commented on GitHub (Jul 8, 2022): 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!
Author
Owner

@thannaske commented on GitHub (Jul 8, 2022):

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.

<!-- gh-comment-id:1179099229 --> @thannaske commented on GitHub (Jul 8, 2022): 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.
Author
Owner

@speed47 commented on GitHub (Jul 8, 2022):

Glad to hear this fixed your issue!

<!-- gh-comment-id:1179155589 --> @speed47 commented on GitHub (Jul 8, 2022): Glad to hear this fixed your issue!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/the-bastion#79
No description provided.