Re: bosh ssh sudo commands
Hi Marco,toggle quoted message Show quoted text
Thank you Marco! Yes indeed, the problem in the Github issue is the exact same Problem I have.
The provided solution in the issue works. Thanks for referencing me to the Github issue and your fast answer.
From: "Voelz, Marco" <marco.voelz(a)sap.com<mailto:marco.voelz(a)sap.com>>
Reply-To: "Discussions about the Cloud Foundry BOSH project." <cf-bosh(a)lists.cloudfoundry.org<mailto:cf-bosh(a)lists.cloudfoundry.org>>
Date: Monday, September 28, 2015 at 8:22 PM
To: "Discussions about the Cloud Foundry BOSH project." <cf-bosh(a)lists.cloudfoundry.org<mailto:cf-bosh(a)lists.cloudfoundry.org>>
Subject: [cf-bosh] Re: bosh ssh sudo commands
your problem might be the same as seen in this github issue: https://github.com/cloudfoundry/bosh/issues/964<https://github.com/cloudfoundry/bosh/issues/964#event-420594944>
`bosh ssh` sets up users which need a password to execute `sudo`. Therefore, you would need to provide the password on the commandline in which you want to execute the command, just as Dmitriy answered in the github issue.
Until the users are setup with password-less sudo, this is pretty much the best you can do, I guess.
On 28/09/15 07:32, "Schwarz-Fritz, Fabian" <fabian.schwarz-fritz(a)sap.com<mailto:fabian.schwarz-fritz(a)sap.com>> wrote:
I do have a technical bosh question regarding bosh ssh . I am curious if you do have any solutions to the problem below or ideas for alternative. Please let me know in case this is the wrong mailing list.
I am currently trying to automate the recovery of an existing snapshot. The snapshot is a backup for a my own bosh-release for a database technology. The boshrelease will have OpenStack as IaaS. I am using several cinder/nova commands (Openstack specific) and then I want to execute several commands on the bosh-vm. Therefore I do need to execute several commands on the bosh-VM where the database is running from the host VM.
In order to do that, I am using bosh ssh "<command>" for example
bosh ssh mongodb/0 “echo blub”
This is working perfectly fine. However, when I automate the recovery a backup, there are a few commands that do need root access. One command could be this one, for example:
bosh ssh mongodb/0 "sudo mount -t ext4 /dev/vdc1 /var/vcap/store_snapshot”
Unfortunately, this is not working. I get a error
sudo: no tty present and no askpass program specified
Does anyone have any help/ideas on how to solve this issue?
Am I using bosh ssh in the wrong way?
Is bosh ssh not made to execute such commands?
Can I solve this by writing an errand and calling the errand in automation script?
I am happy about every idea that helps me solving this issue or letting me better understand the problem.
Thanks a lot in advance,