Last active
October 11, 2019 18:56
-
-
Save hxtree/0594d8c3a9f1f2bf92947688b5e51c84 to your computer and use it in GitHub Desktop.
SSH Deploy Key Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate SSH Key | |
ssh-keygen -o -f ~/.ssh/www.example.com | |
# Add SSH key to your SSH config | |
vim ~/.ssh/config | |
Host www.example.com | |
User git | |
HostName www.example.com | |
IdentityFile ~/.ssh/www.example.com | |
# Add deploy Key to your Repo (e.g. Gitlab, GitHub, etc.) | |
cat ~/.ssh/www.example.com.pub | |
# within the website place text inside repo's Deploy Keys section | |
# enable write access to push, not needed for read. | |
# Push something, e.g. | |
cd /var/www/www.example.com | |
git init | |
git add . | |
git commit -m 'Init repo' | |
git push origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment