Skip to content

Instantly share code, notes, and snippets.

@danhyun
Last active December 14, 2015 00:09
Show Gist options
  • Save danhyun/4997146 to your computer and use it in GitHub Desktop.
Save danhyun/4997146 to your computer and use it in GitHub Desktop.
set up ssh config
[root][henry][~]
$ cd ~/.ssh
[root][henry][~/.ssh]
$ ll -tr config
-rw-r--r-- 1 root root 143 2012-10-04 13:06 config
# note the permissions -> user:group [644]
[root][henry][~/.ssh]
$ cat config
Host *
PreferredAuthentications publickey,keyboard-interactive
ServerAliveInterval 120
ServerAliveCountMax 30
IdentityFile /tmp/secretkeyinanunorthodoxlocation
Host stagingNickname
User stagingUser
Hostname staging.vindale.com
IdentityFile /tmp/Staging_key
Host foosauce
User barsauce
Hostname some.different.server
IdentityFile /tmp/foobarworld.rsa
# now you can just simply say
$ ssh foosauce
$ ssh stagingNickname
# you get scp for free as well!
$ scp foosauce:/opt/tomcat/webapps/app.war ./
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment