vagrant ssh -- EXTRA SSH ARGS
is supposed to allow extra args to be passed to ssh.
vagrant ssh -- -t 'cd /var/www'
should ssh into vagrant and change directory to /var/www
, but doesn't. Instead it returns
ssh: Could not resolve hostname ls: nodename nor servname provided, or not known
What am I missing?
Command: vagrant ssh [name|id] [-- extra_ssh_args] This will SSH into a running Vagrant machine and give you access to a shell. On a simple vagrant project, the instance created will be named default.
Vagrant SSH Once you are done exploring the virtual machine, you can exit the session with CTRL-D.
This works for me:
vagrant ssh -- -t 'cd /var/www; /bin/bash'
To run a command to a vagrant box remotelly run:
vagrant ssh -c "COMMAND; COMMAND1"
If you need, try vagrant ssh --help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With