Pivotal Cloud Foundry® (PCF) 1.6 and above
This article explains how you can run bash command from the Bosh command line utility.
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.
You can run bash commands via Bosh SSH by using the following syntax:
- bosh ssh vm/index "bash command"
- 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/).
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.