User Tools

Site Tools


access_sdf_gitea_using_ssh_keys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
access_sdf_gitea_using_ssh_keys [2022/01/27 01:16] – created from a bboard post by futurile peteyboyaccess_sdf_gitea_using_ssh_keys [2022/02/07 21:37] (current) jquah
Line 1: Line 1:
-spent some time investigating and think I got to the bottom of it.+Futurile spent some time investigating and eventually 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-endyou can see that it exists on ma.sdf.org at /meta/gitea/gitea-repositories/<your userid>/<git-repository-name>.git+Useful information is that the Gitea server (git.sdf.org) is hosted on ma.sdf.org. After your Gitea account is created, it will reside on ma.sdf.org at ''/meta/gitea/gitea-repositories/<your userid>/<git-repository-name>.git''.
  
-  - Create user at https://git.sdf.org +  - Create Gitea account as instructed in [[hosted_git_repos_-_gitea_on_sdf|Hosted git repos]]
-  - Create a repository using the Gitea webapp. You can then check it exists on ma.sdf.org +  - Login to the Gitea webapp and navigate to the repository for which you want SSH key access(Create a new repository if needed.) 
-  - Upload a public ssh key using the Gitea webapp +  - 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. +    * In then Gitea web app go to Settings (top right) and then SSH/GPG Keys. In the Manage SSH Keys select 'Add Key' and upload a public 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:+    * Gitea manages the public SSH key *separately* from any other that you use to normally access ma.sdf.org. Some people are using:
       * their existing ma.sdf.org public ssh key and they're uploading it to gitea       * 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.  +      * a new key pair specifically for this gitea. Either of these is fine.  
-  - Check that public key authentication is working to gitea +  - Check that public key authentication to Gitea is working. 
-    * 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 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+    * The Gitea server is running on port 2222, so our test of public key authentication will specify this port manually. (It is possible for the server to switch seamlessly to port 2222 whenever the 'git' username attempts an SSH connection, but this option has not been configured at present.) 
-    * At the command line load the SSH key, using ssh-agent or however you normally handle your ssh keys.<code>$ keychain ~/.ssh/<the-ssh-key-in-gitea> +    * At the command line, test that your newly-uploaded SSH key is recognized by Gitea. A dedicated stanza for git.sdf.org in $HOME/.ssh/config will load the key automaticallyor you can use ssh-agent as shown below.<code>$ keychain ~/.ssh/<the-ssh-key-in-gitea> 
-    $ ssh -vvv git@git.sdf.org -p 2222</code>+$ ssh -vvv git@git.sdf.org -p 2222</code>
     * You'll see a load of output, if it's successful you'll see:<code>     * You'll see a load of output, if it's successful you'll see:<code>
 Offering public key: <key>  Offering public key: <key> 
 <more output> <more output>
 debug1: Authentication succeeded (publickey). debug1: Authentication succeeded (publickey).
-Authenticated to git.sdf.org ([205.166.94.33]:2222).</code> +Authenticated to git.sdf.org ([205.166.94.33]:2222).</code> The server is not configured to allow shell access over this SSH connection, so the test will terminate automatically and return you to your local machine.
-      * To get out do ~.+
   - Set up your repository one of two ways:   - Set up your repository one of two ways:
     - Use the repository via git     - 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'actually running on port 2222 so you have to add this.<code> +      * The Gitea web page for any empty repository you create will show you the commands for accessing it via ssh. (Once content is uploaded, this information disappears from the landing page of the repository.) Because Gitea is actually running on port 2222you have to add this to the command line provided.<code>$ git pull git@git.sdf.org:2222/<your-sdf-id>/<repository-name>.git 
-  $ git pull git@git.sdf.org:2222/<your-sdf-id>/<repository-name>.git +$ git pull git@git.sdf.org:2222/futurile/futurile-www.git</code> ''or instead''
-  $ git pull git@git.sdf.org:2222/futurile/futurile-www.git</code> ''or instead''+
     - Import an existing repository     - 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.<code>       * I had an existing repository that I wanted to now upload into gitea. To do that we add a new remote.<code>
Line 31: Line 29:
 $ git remote add upstream ssh://git@sdf.org:2222/futurile/futurile-www.git $ git remote add upstream ssh://git@sdf.org:2222/futurile/futurile-www.git
 $ git push upstream master</code> $ git push upstream master</code>
-      * For my own reasons I've called the remote 'master' versus most instructions call it 'origin' - but it's the same thing. +      * For my own reasons I've called the remote 'master' whereas most instructions call it 'origin' - but it's the same thing. 
-  - Check output in gitea +  - Check output in Gitea 
-    * You should see output on the command-line, and when you login to gitea you can see the files there. +    * You should see output on the command-line, and when you login to the Gitea web app you can verify that the files were uploaded.
- +
--- Futurile +
access_sdf_gitea_using_ssh_keys.1643246218.txt.gz · Last modified: 2022/01/27 01:16 by peteyboy