Pivotal Knowledge Base

Follow

How To Run Bash Commands Via Bosh

Environment

 Product  Version
 Pivotal Cloud Foundry® (PCF)  1.6 and above

Purpose

This article explains how you can run bash command from the Bosh command line utility. 

Procedure

Note that to run the following commands, administrative access to your PCF deployment via the Bosh CLI is required. For more information on configuring the Bosh CLI, please click here [1].

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 [1].

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

 

Comments

Powered by Zendesk