# How to SSH Forward on Windows

**URL:** https://discourse.roots.io/t/how-to-ssh-forward-on-windows/5271
**Category:** trellis
**Created:** 2015-11-13T19:02:54Z
**Posts:** 2

## Post 1 by @nbyloff — 2015-11-13T19:02:54Z

For a while I had a convoluted approach to working in Vagrant, deploying new versions, checking out private repos, etc.

I came across a process that might help some people who want to use the same private/public key for Vagrant that you use for GitHub, Bitbucket, and your production servers.

I couldn’t find anything on this forum, so if someone already added this procedure, please disregard. But this process is useful if you:

- You’re on a Windows host (Useful for Mac/Linux too)

- You have private repos as part of your Trellis project

- You want Vagrant to use your already created SSH key pair.

First, in this Vagrantfile, he uses a config file for his public/private key file paths, so if you don’t do that, add your path. For instance, my keys are in `C:\users\myuser\.ssh`

So I just use “~/.ssh/id\_rsa” and “~/.ssh/id\_rsa.pub”

Pay attention to Line 120-166 in this file

> <https://github.com/alt3/cakebox/blob/dev/.cakebox/Vagrantfile.rb#L120-L166>

Then get his two ssh scripts from this folder ([check-ssh-agent.sh](http://check-ssh-agent.sh) and [ssh-authentication.sh](http://ssh-authentication.sh)) and add them to your ansible folder.

> **[alt3/cakebox](https://github.com/alt3/cakebox/tree/dev/.cakebox/bash)**
>
> cakebox - Framework agnostic virtual PHP Development Environment

Again, make sure you fix all the path(s) for your local environment.

After doing this, and `vagrant up`, I can login to the vagrant machine with my standard keys I use on Github. This also lets me checkout things easily without copying any keys over, and deploy new versions of my site.

On putty, make sure that you have the `Allow agent forwarding` box checked and your private key file selected. (Under Connection–\>SSH–\>Auth).

**Note** I did a `vagrant destroy` before doing this. There’s probably a way to do it without having to do that, but I can get everything synced up in a couple commands so I took the easy route.

I wonder if this kind of setup is worth including in the main project since it works on Mac, Linux, AND Windows? Especially allowing for a config file.

---

## Post 2 by @nbyloff — 2015-11-16T15:20:08Z

Also note that they setup databases, and pull repos and get a fully working instance up and rolling with the first Vagrant up. So if a config file were used, checking out this project could get a user running in one command/step with either

- A blank default install of Trellis, Bedrock, and Sage ready to be customized

- Couple changes to a config allows user to checkout an already started customized, private repo and continue working.

I will put together a demonstration on a fork if anyone is interested.
