Initial commit

This commit is contained in:
robojerk 2025-06-03 12:07:38 -07:00
commit 96a5720497
3 changed files with 546 additions and 0 deletions

44
readme.md Normal file
View file

@ -0,0 +1,44 @@
This is a powershell script that will create a a ssh key
assume forgejo is installed (via docker)
ask for email address
run
```powershell
echo "Please remember your passphrase. Write it down. Keep it safe"
ssh-keygen -t ed25519 -C "rraines@gmail.com"
```
These file are create
C:\Users\{user}\.ssh\id_ed25519
C:\Users\{user}\.ssh\id_ed25519.pub
Use cat ( or cat equivalent on powershell) to view "C:\Users\{user}\.ssh\id_ed25519.pub"
```powershell
cls
# Copy the contents below
cat "C:\Users\{user}\.ssh\id_ed25519.pub"
```
Login to your forgejo web server
Click on your **profile avatar** (top right corner)
Select **"Settings"**.
In the left sidebar, click on **"SSH / GPG Keys"**.
Click the **"Add Key"** button.
Give your key a descriptive **"Title"** (e.g., "Rob's Laptop Key").
Paste the entire public key into the "Content" text area.
After adding, you'll see your key listed. Click the **"Verify"** button next to it.
* Forgejo will provide a unique **challenge token** and three different commands. You need to run one of these commands in your local terminal.
```powershell
echo "Please copy the token on the web page"
echo "for example c9fb7f60219b73d1819d9fe548a43e3a041484f8d7466dd212b4e8cde9e0e3d8"
```
set $TOKEN to what the user inputs
Verify that the inputted token matches the required parameters. i.e. length, no spaces etc
run "cmd /c "<NUL set /p=`"$TOKEN`"| ssh-keygen"
```powershell
Paste the contents into the window and ***verify***