Example SSH Config (.ssh/config)

To make it easier to ssh (and enable autocomplete), create a ~/.ssh/config like this: Host * SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes PreferredAuthentications publickey,password IdentityFile ~/.ssh/id_rsa ServerAliveInterval 60 Compression yes CompressionLevel 4 Host github Hostname github.com User git and you will always use user git when you ssh to github

August 28, 2014  |  🏷️ssh

SSH Agent

If you has a rsa-key and don’t want to write in your credentials every time you ssh, you can use ssh-agent instead. Add this to your .bash_profile (or make it a standalone script you execute once at startup) SSHAGENT=$(command -v ssh-agent) SSHAGENTARGS="-s" if ! pgrep -xu $USER ssh-agent &>/dev/null; then if [[ -z "$SSH_AUTH_SOCK" && -x "$SSHAGENT" ]]; then eval "$($SSHAGENT $SSHAGENTARGS)" trap "kill $SSH_AGENT_PID" 0 fi fi Then you add you credentials once by typing ssh-add (which will add ~/....

August 28, 2014  |  🏷️ssh