Posted 11 months ago. Visible to the public.

Vagrant: create entry for box in .ssh/config

If you want to ssh into your vagrant box without switching into the project directory and typing vagrant ssh, you can also create an entry directly in ~/.ssh/config. This will allow you to use ssh <my-box> from anywhere. Simply paste the information provided by vagrant ssh-config to your ~/.ssh/config-File: vagrant ssh-config >> ~/.ssh/config


$ vagrant ssh-config Host foobar-dev HostName User vagrant Port 2200 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /home/daniel/project/myproject/vagrant/.vagrant/machines/foobar-dev/virtualbox/private_key IdentitiesOnly yes LogLevel FATAL


Vagrant is a tool that allows you to define a Virtual Machine (Image to use, network settings, shared folders to mount…) in a configuration file (Vagrantfile). It's also possible to directly provision the VM with a CMS like Puppet to have the machine in a desired state. Upon creation Vagrant will set up a new VM and add a SSH-Key so you can ssh into the machine. Normally you would switch to the directory containing the Vagrantfile and use the command line tool vagrant ssh to log in to your machine.

Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Owner of this card:

Daniel Straßner
Last edit:
11 months ago
by Daniel Straßner
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Daniel Straßner to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more