Read more

Vagrant: create entry for box in .ssh/config

Daniel Straßner
August 16, 2017Software engineer at makandra GmbH

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

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

Example:

$ vagrant ssh-config
Host foobar-dev
  HostName 127.0.0.1
  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

Background:

Vagrant Show archive.org snapshot 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.

Posted by Daniel Straßner to makandra dev (2017-08-16 10:01)