Bamboo SSH Task - Run sudo commands

Edwin Perez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 19, 2014

I set up a bamboo box and am working on a deployment task. If I try to run any sudo command from the SSH task, I get the following error: "sudo: no tty present and no askpass program specified Sorry, try again."

I have read through some fixes:

  • Remove the following line in sudoers file: Defaults requiretty
    • sudoers file on server does not have this.
  • Run ssh with -t command
    • Do not know how to achieve this in bamboo.
  • Use RSA tokens to connect bamboo server with remote server.
    • Got the token (user ssh-keygen -t rsa), however, I get the following error:
      • There is something wrong with your private key: java.io.IOException: Could not read key pair from: [PrivateKeyStringResource]

Anybody know how I can acomplish any of those tasks. I need to be able to run some sudo commands on remote server.

Thanks.

4 answers

3 votes
jan roman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 15, 2015

If you using putty gen to create your private key. You need to save it in open ssh format. Conversions -> Export OpenSSH Key

0 votes
Kanstantsin Kniaziuk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 5, 2014

IMHO you should tune your remote server.

You can try this approach:

http://askubuntu.com/questions/159007/how-do-i-run-specific-sudo-commands-without-a-password

0 votes
demelvin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2014

Also experiencing this issue.

 

  • There is something wrong with your private key: java.io.IOException: Could not read key pair from: [PrivateKeyStringResource]

Any luck on solving this?

 

0 votes
Ryo Chiba
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 2, 2014

I too am having this issue and have read through these fixes with the same results.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events