User Tools

Site Tools


access_sdf_gitea_using_ssh_keys

This is an old revision of the document!


I spent some time investigating and think I got to the bottom of it.

Useful information is that the gitea server (git.sdf.org) is hosted on ma.sdf.org. After you've created a user using the gitea web front-end, you can see that it exists on ma.sdf.org at /meta/gitea/gitea-repositories/<your userid>/<git-repository-name>.git

  1. Create user at https://git.sdf.org
  2. Create a repository using the Gitea webapp. You can then check it exists on ma.sdf.org
  3. Upload a public ssh key using the Gitea webapp
    • In then Gitea Web app go to Settings (top left) and then SSH/GPG Keys. In the Manage SSH Keys select 'Add Key' and upload a publich SSH key.
    • Gitea manages the public SSH key *separately* from any other that you use to normally access ma.sdf.org. In this thread there are people who are using:
      • their existing ma.sdf.org public ssh key and they're uploading it to gitea
      • generating a new key pair (specifically for this gitea) and uploading the public key part. Either of these is fine.
  4. Check that public key authentication is working to gitea
    • The gitea server is running on the system as the 'git' user, so you need to ssh into it using 'git' as the username (rather than your normal sdf username).
    • The gitea server is running on port 2222, so we need to connect to it on this port check it's working and authenticating the public key.
    • At the command line load the SSH key, using ssh-agent or however you normally handle your ssh keys.
      $ keychain ~/.ssh/<the-ssh-key-in-gitea>
          $ ssh -vvv git@git.sdf.org -p 2222
    • You'll see a load of output, if it's successful you'll see:
      Offering public key: <key> 
      <more output>
      debug1: Authentication succeeded (publickey).
      Authenticated to git.sdf.org ([205.166.94.33]:2222).
      • To get out do ~.
  5. Set up your repository one of two ways:
    1. Use the repository via git
      • In the gitea web page for the repository you created it shows you information about how to access it via ssh. Remember that it's actually running on port 2222 so you have to add this.
          $ git pull git@git.sdf.org:2222/<your-sdf-id>/<repository-name>.git
          $ git pull git@git.sdf.org:2222/futurile/futurile-www.git

        or instead

    2. Import an existing repository
      • I had an existing repository that I wanted to now upload into gitea. To do that we add a new remote.
        $ git remote add <name> <url>
        $ git remote add upstream ssh://git@sdf.org:2222/futurile/futurile-www.git
        $ git push upstream master
      • For my own reasons I've called the remote 'master' versus most instructions call it 'origin' - but it's the same thing.
  6. Check output in gitea
    • You should see output on the command-line, and when you login to gitea you can see the files there.

– Futurile

access_sdf_gitea_using_ssh_keys.1643246218.txt.gz · Last modified: 2022/01/27 01:16 by peteyboy