L&D series: Generate GitHub SSH key
2 min readMay 22, 2022
Learning and Development chapter 17.
What is SSH key?
Secure Shell or known as SSH key is a key that have access for credential used within the SSH protocol.
Generate SSH key
- Open terminal then type
ssh-keygen -t rsa
. - Press enter on keyboard. Input
y
if ssh file already exist.
Where to store the key?
We can store at GitHub setting also GitHub secret at the same time.
Store id_rsa.pub
to GitHub settings:
- On terminal, type
pbcopy < ~/.ssh/id_rsa.pub
. - Go to https://github.com/settings/keys
- Click
New SSH key
button
- Input SSH name in Title.
- Paste the SSH key from
pbcopy
command. - Click
Add SSH key
button.
- Input GitHub password.
We only can delete the added SSH key, but we can add multiple SSH key.
Store id_rsa
to GitHub secret:
- On terminal, type
pbcopy < ~/.ssh/id_rsa
. - Go to our repo link + /settings/secrets/actions.
- Click New repository secret button.
- Input Name for secret name.
- Input token in Value field.
- Click Add secret button.
Do you still use the password for github auth? — MperMperPisang
Reference