No commit activity in last 3 years
No release in over 3 years
Makes it possible to use 'ssh' to login to a Vagrant VM, without adding multiple fake hosts to ~/.ssh/config
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.0.0
 Project Readme

vagrant-proxyssh

A small hack to enable ssh'ing to Vagrant VMs directly from the command-line.

My personal use-case is in system-level tests where ssh is used as a part of the program. It's much easier just to have a test-specific hostname (vagrant), than having to write special-cased code to do a vagrant ssh, or having to add a custom host to ~/.ssh/config for each Vagrant VM.

Requirements

Requires nc (netcat). It also currently only works when the Vagrant VMs have a standard SSH-setup.

Installation

Use vagrant gem install vagrant-proxyssh if you have a packaged installation of Vagrant.

Use gem install vagrant-proxyssh if you have Vagrant installed directly as a gem.

Use gem "vagrant-proxyssh" if you bundle Vagrant in a Gemfile.

Run vagrant proxy-ssh --setup somewhere with an active Vagrant to add the necessary configuration to ~/.ssh/config.

The setup routine assumes your login environment has the right Ruby-version in its path.

OS X

On OS X, your login environment is determined by ~/.MacOSX/environment.plist, and may not reflect what you have in your .bashrc, .zshrc, or such.

Specifically, things may not work with Rubies installed with RVM, rbenv, or Homebrew, since none of the usual paths are in the default environment.

Usage

After installation and setup, you can ssh vagrant from your project directory, and it'll work just like vagrant ssh.