SSH Setup
This will help you get through the SSH setup.
Windows Pre-requisites
If you are on Windows, you need to install the Windows Subsystem for Linux. Please go read and do that first.
Using the script
I wrote a Bash script that will help automate the process. It is located in our GitHub scripts repo. To get the script, do the following:
git clone https://github.com/ojosproject/scripts
cd scripts/ssh-setup/
To run it, do...
bash ssh-setup.sh
The file will do the following things:
- Generate an SSH key for GitHub
- Modify your
config
file in the.ssh
folder to addgit@github.com
- Print your public key, that you need to add to GitHub.
Once that's done, add your key to GitHub, ensure it's a key for
Authentication
, and you're set!
Using the SSH Agent
If you ran the
linux-setup.sh
file
during your Linux setup, you have two useful commands.
# activates the SSH Agent
# adds GitLab identity
# NEEDS TO BE DONE EVERY TERMINAL SESSION
activate
# if you don't know if the SSH agent is active, run this command
check
If you want to learn how to do this manually, which I highly encourage, read the old documentation here.
Concluding
Once you've created the key, added it to GitHub, and started the SSH agent, you should be able to test it using this command:
ssh git@github.com
... and get a response similar to:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
Thank you for your patience. This will happen a lot.