Skip to content

Instantly share code, notes, and snippets.

@hamecoded
Last active October 14, 2015 00:18
Show Gist options
  • Save hamecoded/4278368 to your computer and use it in GitHub Desktop.
Save hamecoded/4278368 to your computer and use it in GitHub Desktop.
Associating SSH public key with hostcopy to clipboard the public key:cat name_dsa.pub | pbcopy
0 - no access to the file whatsoever
1 - execute permissions only
2 - write permissions only
3 - write and execute permissions
4 - read permissions only
5 - read and execute permissions
6 - read and write permissions
7 - read, write and execute permissions (full permissions)
Owner / UserGroupOther/ Everyone
# ~/.ssh/config
Host heroku.com
User name
IdentityFile ~/.ssh/name_dsa
Host github.com
User name
IdentityFile ~/.ssh/github_rsa
Host bitbucket.org
User name
IdentityFile ~/.ssh/bitbucket_dsa
Host one
HostName site.co.il
User superman
Compression yes
cd ~/.ssh
ssh-keygen -t rsa -C "email@gmail.com"
ssh-add github_rsa
pbcopy < github_rsa.pub
# -rw-r--r--
chmod 644 github_rsa.pub
# -rw-------
chmod 600 github_rsa
# re-add ssh key if passphrase is inaccesible
ssh-add ~/.ssh/github_rsa
# check authenticity to the host
git:(master) ssh -T -o "VerifyHostKeyDNS ask" git@github.com
Hi hamecoded! You've successfully authenticated, but GitHub does not provide shell access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment