Skip to content

Instantly share code, notes, and snippets.

@Ryel
Last active February 15, 2021 15:46
Show Gist options
  • Save Ryel/2b7882df5c089c606a375b5c9ceb6b99 to your computer and use it in GitHub Desktop.
Save Ryel/2b7882df5c089c606a375b5c9ceb6b99 to your computer and use it in GitHub Desktop.
SSH Config
#-----------
# SSH Config
#-----------
#
#
# Easily ssh into servers and manage connections with this config.
#
# This file should be here:
# ~/.ssh/config
#
# Usage: $ ssh <Host>
#
# Example:
# $ ssh web-app-dev
#
# List all connections available in this configuration:
# $ ssh-hosts
#
#
# This is a quick overview. For further reading please refer to
# the SSHConfig man pages `man ssh_config`
#
# Host <host> #<describe your remote>
# HostName <hostname>
# IdentityFile <~/.ssh/key.pem>
# User <user>#
#
# Host - The shortcut you will use with ssh. IE `ssh <host>`
# User - User of the server you will SSH into. IE: root by default on Ubuntu.
# IdentityFile
#
# Note: Pattern matching with `*` is supported here so you can do cool things like:
# Host ec2-*.us-east-1.compute.amazonaws.com
#
# `ssh-hosts` support:
# Put this in your $HOME/.bash_profile equivalent for ssh-hosts support.
# # List available SSH connections
# alias ssh-hosts="grep "^Host" $HOME/.ssh/config | sed 's/Host //'"
#
# OSX Password prompt on SSH.
Host *
UseKeychain yes
#----------------------
# <Name of connection>
#----------------------
Host <connection-name> #<describe-connection>
HostName <hostname>
Port <port>
User <user>
ServerAliveInterval 120
IdentityFile ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment