After building vagrant machine the command to ssh into the guest machine is pretty simple.
vagarnt ssh
While working with chef I needed to explicitly ssh into the vagrant machine. It took me sometime to figure it out.
The key is command vagrant ssh-config. The output might look like this.
$ vagrant ssh-config
Host vmachine
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /Users/nsingh/code/vagrant-machine/.vagrant/machines/vmachine/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
ForwardAgent yes
Open ~/.ssh/config and paste the output at the end of the file and save the
file.
Now I can ssh into vagrant machine using ssh command as shown below.
ssh vmachine
If you are wondering from where the name vmachine came then this is the name I
had given to
my vagrant machine
.

Written byNeeraj Singh
Related blogs
- 01Benchmarking Crunchy Data for latencyOctober 15, 2024 · Vishnu M
- 02Improving NeetoRecord reach with Twitter player cardsAugust 16, 2024 · Bonnie Simon
- 03Honeybadger frontend integration in Neeto appsDecember 12, 2023 · Calvin Chiramal
- 04Deep Dive into Redis Data TypesNovember 14, 2023 · Sreeram Venkitesh