Accessing AWS EC2 instances with Emacs/TRAMP + Putty/Plink/Pageant on Windows

Summary

Make accessing EC2 instances more enjoyable by connecting via Tramp

I've been working on AWS and EC2 for a little while now. I found it's useful to connect to the instance using Emacs.

Here are the steps to connect with Emacs/TRAMP:

  • Start pageant and load up the instance's keys ppk fie
  • Connect using: /plink:ec2-user@12.34.56.78:/

If I need to access a shell on the remote machine, I can do the following:

(setq explicit-shell-file-name "/bin/bash")

Additional

Note: If I don't have pageant running before I try to access the server, I will get a non-intuitive warning about being unable to create a directory.