diff options
author | William Carroll <wpcarro@gmail.com> | 2017-07-30T16·13-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2017-07-30T16·13-0400 |
commit | 4332e33a74a927e3f19c114f586888fb6dbd9454 (patch) | |
tree | 0bd53645965045af0b4efdcb3430a5d577c62bb1 /README.md | |
parent | a5d8c0d3d03f9f98d49441cf5aba3907eb3fa46c (diff) |
Documents SSH tooling
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/README.md b/README.md index 4ce60a142271..71575409c419 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,63 @@ scripting. That is too severe. Instead, I see this as a necessary upgrade for my foray into writing more sophisticated tools for myself and others. +# SSH + +Here are a few useful tips for working with SSH. + +## ssh_config + +Instead of creating shell aliases and functions for conveniently accessing remote nodes over SSH, +edit your `~/.ssh/config` file. + +Instead of doing this... + +```bash +$ alias ec2='ssh -i /path/to/identity_file.pem ubuntu@<ec2-instance-public-ip>' +``` + +...edit your `~/.ssh/config`: + +``` +Host ec2 + User ubuntu + HostName <ec2-instance-public-ip> + IdentityFile /path/to/identity_file.pem + +# Host * configuration below... +``` + +## sshfs + +SSHFS enables seamless file transfers from your local machine to a remote machine. + +To install, run: + +```bash +$ brew cask install osxfuse +$ brew install sshfs +``` + +Assuming your remote machine is configured in your `~/.ssh/config` (see above), you can mount your +remote machine's home directory on your local machine like so: + +```bash +$ mkdir ~/ec2 +$ sshfs ec2:/home/ubuntu ~/ec2 -o reconnect,follow_symlinks +``` + +Now your remote machine's home directory can be accessed using the `~/ec2` directory. This directory +can be transparently treated as if it were an ordinary local directory. To illustrate how easy it is +to use, let's install `Vundle`, a Vim package manager, on our remote machine. + +```bash +$ git clone https://github.com/VundleVim/Vundle.vim.git ~/ec2/.vim/bundle/Vundle.vim +``` + +Voila! We now have `Vundle` installed on our ec2 instance without needing to SSH into that machine +ourselves. That's all there is to it. + + # GnuPG 1. Download public key from keyserver |