If I understood you correctly, your setup looks like this:
Windows box with PuTTY Pageant + your private key -(PuTTY)-> Vagrant host machine -("vagrant ssh")-> LXC box
.
In any case, you should let the sshd running on LXC box know about your public keys: put the public key as a separate entry to $HOME/.ssh/authorized_keys
, where $HOME
is the home directory of the user you log in with ("vagrant"
is default, but use whatever you chose before). Note that this is the public part of the key that you load into PuTTY's Pageant. Note also that PuTTY private key format is not compatible with OpenSSH, so you can't use your PuTTY's private key file with ssh on your Vagrant host box.
This will probably be enough.
I cannot test the setup identical to yours, but "Windows box -(Putty)-> some host (ssh)-> some other host"
combo works with the configuration I mentioned. I assume that "vagrant up"
, which you most likely use, does nothing fancier than calling whatever ssh
you have on Vagrant host with the "vagrant@<lcx-box-ip> -P <vagrant-ssh-port>"
, meaning that SSH does the actual key exchange. In this case everything works as I described.
If this does not work for some reason, try "vagrant ssh -p"
, or try connecting from your Windows box via PuTTY directly to the LXC box -- Vagrant has forwarded the SSH port 22 of LXC box to some other port (2222 is default), so connecting via PuTTY to "vagrant@<vagrant-host-ip> -P 2222"
should work as well.
Hope this helps.