I'm an experienced web developer, software engineer, and leader. Welcome to my blog. If you need to reach out you can continue the conversation with a tweet to @geedew. I hope you find what you are looking for here. You can also find me on Github and StackOverflow.

Copying Files to a Vagrant VM from the Host

I ran into a case where I wanted to have a file that exists on my local also exist on a Vagrant VM. I didn’t need it to be shared; using a shared directory. I also couldn’t move the file to the Vagrantfile path and use the default mounted directory to move it. Instead, I needed a way to use scp to push a file from the host to the guest. Vagrant provides an API that is key to making scp work. With some piping and tools; providing the right credentials for scp is easy.

I also commented on StackOverflow

Quickly Remove a Known-Host Entry

I’ve had plenty of scenarios in development where I have updated a development machine and the credentials are updated causing SSH errors. This happens frequently in Vagrant as well. But it’s simple and quick to remove the old known signature.

When updating your known_hosts; make sure that you understand what you are doing. The known_hosts entries are there to protect you by cryptographically validating a server really is who they say they are. IE: Do Not Delete Things You Don’t Trust.

1
2
3
4
5
6
7
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is

Password-less, Secure Server Login with SSH Keys

SSH keys should be your standard, go-to for interacting with any remote server. They remove the need to memorize a server password. They allow you to login programmatically, and they give your local operating system the chance to handle the caching of your password in your keychain. It’s also very simple.

A few rules you should always follow.

  • Always make a passphrase.
  • Don’t use the same SSH key on multiple important servers.
  • Don’t share the private key.

    Read More