Files
2020-01-16 17:33:37 -06:00

2.0 KiB

Setting up SSH

Covered in this guide

  1. Generating a new ssh key
  2. Adding key to be used
  3. Uploading public key into Gitea

What you need to do everytime you boot

If you have never done this before, skip this section and go to Steps below, else:

  1. Start the agent: eval $(ssh-agent -s)
  2. Add the key: ssh-add C:\Users\%username%\.ssh\id_rsa

Steps

  1. Download and install Git for Windows
  2. NOTE: if you already have this installed, make sure you don't have ssh-keys already generated by navigating to: C:\Users\%username%\.ssh
  3. Assuming this is your first time, generate a new key (please change %username% to your username! - you may also use your email address): ssh-keygen -t rsa -b 4096 -C "%username%"
  4. When it asks you where to save, just press enter. It will default to C:\Users\%username%\.ssh
  5. It will then ask for a passphrase. This isn't required, but you can add one if you so please; or, just press enter.
  6. Next, we need to add the new key to the Windows git agent, letting it know we can use this key.
  7. Start the agent: eval $(ssh-agent -s)
  8. Then add the key: ssh-add C:\Users\%username%\.ssh\id_rsa
  9. Now add your public key to Dou.Git
  10. Log in to Gitea and in upper right hand corner click on arrow and select "Settings" (Figure 1).
  11. Then click on SSH/GPG Keys.
  12. Then click on "Add Key" (Figure 2).
  13. Name the key something like your username and paste the contents of C:\Users\%username%\.ssh\id_rsa_pub and then click "Add Key" (Figure 3).
  14. Congrats! You are now able to make changes, edits, and commits using SSH!
Git-userSettings
Figure 1
Git-importSSH
Figure 2
Git-addSSHkey
Figure 3