Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bamboo SSH Task - Run sudo commands

Edwin Perez 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 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 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 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 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