How to Run Bash Commands via BOSH
search cancel

How to Run Bash Commands via BOSH

book

Article ID: 297765

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

This article explains how you can run Bash Command from the BOSH command line utility.


Environment


Resolution

Note that to run the following commands, administrative access to your Pivotal Cloud Foundry Application Service deployment via the BOSH CLI is required. For more information on configuring the BOSH CLI, please click here.

You can run Bash Commands via BOSH SSH by using the following syntax:

  • BOSH SSH vm/index "bash command"

For example:

  • BOSH SSH cloud_controller-partition-a1325d9aebac3fc7446f/0 "df -h"
  • BOSH SSH cloud_controller-partition-a1325d9aebac3fc7446f/0 "sudo /var/vcap/bosh/bin/monit summary"
  • BOSH SSH cloud_controller-partition-a1325d9aebac3fc7446f/0 "sudo /var/vcap/bosh/bin/monit restart consul_agent"

Note: You will need to include the full path with your command as shown above (/var/vcap/bosh/bin/).


Additional Information

Authentication: When running BOSH SSH commands, you will be authenticated using a temporary username and password provided by BOSH. You will not need to provide any additional username or password when running your commands as you will have authenticated already with BOSH.

For more information on configuring the BOSH CLI, please click here.

https://bosh.io/docs/bosh-cli.html