You can use the Bamboo SSH task to execute a SSH command on a remote computer as part of a Bamboo job.
See Configuring a deployment task for an overview of Bamboo deployment tasks.
Related pages:
To configure an SSH task:
- Navigate to the Tasks configuration tab for the job (this will be the default job if creating a new plan).
- Click the name of an existing SSH task, or click Add Task and then SSH Task to create a new task.
Complete the following settings:
Task Description Helps you identify the purpose of the task. Disable this task Check, or clear, to selectively run this task. Host The hostname or IP address of the remote server on which the SSH Command will be executed. Verify remote host fingerprint on connect Enter the host fingerprint to be verified. See below for more details. Port The port number of the remote host that is used for the SSH connection. The default value is 22. Username The username to use to connect to the remote host. Authentication Type Password – the password associated with Username. Key without passphrase – browse to the SSH private key with which to authenticate with the remote host. Key with passphrase – browse to the SSH private key, and supply the passphrase, to use to authenticate with the remote host. SSH Command The shell command to execute on the remote host. You can only enter a single command here. - Click Save.
Host fingerprint
You can determine the fingerprint for a host by running:
ssh-keygen -l -F <HOSTNAME>
The fingerprint is the part of the response shown in the screenshot below:
11 Comments
-
Anonymous
Would it be a nice feature to be able to set a base directory here from which the command will execute?
-
Anonymous
If you have a multi-line command, are the lines run in sequence?
-
Anonymous
Is there a plan to support multi-line command's?
-
When executing commands through the SSH-task, the output from commands are only updated after each command line is executed. Is there any plans to change this behaviour so that the command ouput is shown in Bamboo's deployment log more regularly, i.e updated at a given interval?
-
I need to run a command with sudo but I'm getting "sudo: sorry, you must have a tty to run sudo".
To avoid this error and be able to run a sudo command I need to specify -t option to the ssh command. There is any way to do this ?
-
Hi Alvaro,
I'm not sure what could be the problem here. Could you contact our support team? They would be better equipped to help you.
Thanks
James
-
-
Anonymous
Hi.
How i can used variables in "SSH command" field?
Thx
-
Hi, what exactly are you trying to achieve? Can you provide a few more details?
Cheers,
Nathan
-
Same request here. I'd like to be able to put into the SSH command box something like:
touch "${bamboo.build.number}.txt"
Without it, the benefits of using bamboo deployments are very limited as we need to create a lot of environment-specific tasks.
-
-


You can use the SSH task to do such things as: