| Account | Purpose | Repo Origin | SSH Key | GPG Key | Encryption |
|---|---|---|---|---|---|
| dev | Development | git@github.com:dev-user/dev-repo.git |
/root/.ssh/id_dev_ed25519 |
dev <kntjspr26@gmail.com> |
git-crypt (Dev PGP) |
| prod | Production | git@github.com:prod-user/prod-repo.git |
/root/.ssh/id_prod_ed25519 |
prod <other@mail.com> |
git-crypt (Prod PGP) |
Everything runs in WSL, keys stored under root, users without root cannot access or push.
sudo su
mkdir -p /root/.ssh && chmod 700 /root/.ssh
ssh-keygen -t ed25519 -C "dev@github" -f /root/.ssh/id_dev_ed25519
ssh-keygen -t ed25519 -C "prod@github" -f /root/.ssh/id_prod_ed25519
chmod 600 /root/.ssh/id_* View public keys and add them to each GitHub account:
cat /root/.ssh/id_dev_ed25519.pub
cat /root/.ssh/id_prod_ed25519.pubAdd those in GitHub → Settings → SSH and GPG keys → New SSH key.
Create /root/.ssh/config:
sudo nano /root/.ssh/configPaste:
# Dev account
Host github-dev
HostName github.com
User git
IdentityFile /root/.ssh/id_dev_ed25519
IdentitiesOnly yes
# Prod account
Host github-prod
HostName github.com
User git
IdentityFile /root/.ssh/id_prod_ed25519
IdentitiesOnly yes
ssh -T github-dev
ssh -T github-prodYou should see:
Hi <user>! You've successfully authenticated, but GitHub does not provide shell access.
cd /path/to/dev-repo
git init
git remote add origin github-dev:dev-user/dev-repo.git
git config user.name "Dev Account"
git config user.email "dev@github"cd /path/to/prod-repo
git init
git remote add origin github-prod:prod-user/prod-repo.git
git config user.name "Prod Account"
git config user.email "prod@github"sudo gpg --import /mnt/b/dev-private-key.asc
sudo gpg --list-secret-keys --keyid-format=longFind the key ID (like 980F354B5EEF0B51).
Then set it for git:
gpg --list-keys --fingerprint
git config --global user.signingkey 980F354B5EEF0B51
git config --global commit.gpgsign truesudo gpg --quick-generate-key "prod <prod@mail.com>" rsa4096 sign,encrypt 2y
sudo gpg --list-secret-keys --keyid-format=longNote the new key ID (e.g. ABC123DEF456GHI7).
cd /path/to/dev-repo
git-crypt init
git-crypt add-gpg-user --trusted 980F354B5EEF0B51
git add . && git commit -m "init encryption"cd /path/to/prod-repo
git-crypt init
git-crypt add-gpg-user --trusted ABC123DEF456GHI7
git add . && git commit -m "init encryption"git push -u origin maingit push -u origin main| Component | Location | Owner | Purpose |
|---|---|---|---|
| SSH keys | /root/.ssh/id_dev_ed25519, /root/.ssh/id_prod_ed25519 |
root | Secure authentication |
| GPG keys | gpg --list-secret-keys |
root | Encryption/signing |
| Config | /root/.ssh/config |
root | Maps two accounts |
| Git repos | /home/archclx/... |
user | Working copies |
Would you like me to include automation scripts (bash) to fully replicate this on fresh WSL systems?