• Cody Bonney
  • July 06, 2015
vagrant

Pass an SSH command to a Vagrant machine

The vagrant ssh command accepts an option (-c or --command) which allows you to pass in a single command to the virtual machine.

$ vagrant ssh --command 'sudo service apache restart'

more SSH posts

linux Copying an SSH public key to a server
linux Adding a passphrase to an existing SSH private key