E15 · Key on the keyring
15 minCreate the SSH key, run gh auth login and choose SSH, then test with ssh -T git@github.com.
Done when: The reply starts with "Hi" followed by your GitHub username.
Lesson 8 · 20 min
Saving, sending, and putting it online are three steps and three decisions. With an SSH key and gh, you send the project to GitHub, publish the page at an address that opens on your phone, and bring the same folder to a VPS, where the agent works even when your computer is off.
Start the lesson
Objective: connect the terminal to GitHub with an SSH key, publish the page on GitHub Pages, and clone the project to a VPS.
GitHub is the bridge between your computer, the page, and the VPS.
Scroll down: each step below lights up its part of the diagram.
The private key never leaves here. The commit saves the version only on your computer; nothing goes online until you decide to send it.
The push sends the versions. Public repository: anyone can see it (and that’s required for the free page). Private: only you and the people you invite. You choose when you create it.
Putting it online is one more step. Once Pages is turned on, each push updates the page in a few minutes, at an address that opens on your phone.
A rented room: the provider supplies the machine; users, updates, and programs are up to you. You log in with ssh, navigate using Linux names, and get the project from GitHub.
The commit stays on your computer, the push takes it to GitHub, and Pages puts it online. The VPS gets the same version with git pull. Each step is your decision, with its own check.
The public key (.pub) is the padlock: it goes to GitHub and the VPS. The private key is the key on your key ring: it stays with you.
Click each step.
ssh-keygen comes with Windows 10 and 11. It asks three questions: where to save the key and for an extra password, twice. Pressing Enter three times works for practice.
Two files go in %USERPROFILE%\.ssh: id_ed25519 (private, never leaves there) and id_ed25519.pub (public).
You already have a key: answer n and use the existing one.
Answer: GitHub.com → SSH → choose id_ed25519.pub → Login with a web browser. Copy the code, paste it in your browser, and authorize.
ssh -T git@github.com tests the key; the first time, answer yes.
Hi SEU-USUARIO! You've successfully authenticated.
Destination: git remote -v shows where it goes. Status: git status is clean. Versions: git log --oneline shows what would be sent. Secrets: no .env in the list.
Once sent, the content is available to anyone with access to the destination.
Anyone can see it. No personal drafts or keys.
ssh root@IP-DA-VPS opens the VPS terminal in your window. The start of the line changes and ends in # or $: always check which machine you’re on before each command.
There: use ls instead of dir, pwd instead of running cd by itself, and uppercase letters matter.
Changed how you log in? Test it in a new window before closing the one that works.
Replace Seu Nome, seu@email.com, SEU-USUARIO, and IP-DA-VPS with your own.
git config --global user.name "Seu Nome" git config --global user.email "seu@email.com" git config --global --list
ssh-keygen -t ed25519 -C "seu@email.com" explorer %USERPROFILE%\.ssh
gh auth login ssh -T git@github.com
cd %USERPROFILE%\projetos\meu-primeiro-agente git status git branch -M main gh repo create meu-primeiro-agente --public --source=. --push
gh api repos/{owner}/{repo}/pages -X POST -f "source[branch]=main" -f "source[path]=/"git status git add . git commit -m "o que mudou" git push
ssh root@IP-DA-VPS mkdir -p ~/projetos cd ~/projetos apt update && apt install -y git git clone https://github.com/SEU-USUARIO/meu-primeiro-agente.git cd meu-primeiro-agente ls git pull exit
curl -fsSL https://claude.ai/install.sh | bash cd ~/projetos/meu-primeiro-agente claude
C:\Users\ana> ssh -T git@github.com Hi ana-exemplo! You've successfully authenticated, but GitHub does not provide shell access. C:\Users\ana\projetos\meu-primeiro-agente> gh repo create meu-primeiro-agente --public --source=. --push ✓ Created repository ana-exemplo/meu-primeiro-agente on GitHub
A few minutes after turning on Pages, the page opens at https://ana-exemplo.github.io/meu-primeiro-agente/.
dir and git log --oneline.git pull, then git push.Someone asked for your key “to set up access”: only id_ed25519.pub. The id_ed25519 file, without .pub, never leaves your computer.
Same navigation, different names. Check the start of the line.
Missions
203.0.113.10).pwd).mkdir -p ~/projetos).ana-exemplo).cd).ls).Simulation: the IP, username, and codes are examples (203.0.113.10 is an address reserved for documentation).
The live page is required; the VPS is optional until you have one.
Create the SSH key, run gh auth login and choose SSH, then test with ssh -T git@github.com.
Done when: The reply starts with "Hi" followed by your GitHub username.
Check the four points, create a public repository, turn on Pages, then make a change and run the add, commit, and push routine.
Done when: The page opens on your phone at https://SEU-USUARIO.github.io/meu-primeiro-agente/ and the change appears after the push.
On an Ubuntu VPS set up with your public key, connect with ssh, clone the project, make a change on Windows, push it, and bring it over with git pull.
Done when: ls on the VPS shows the files, and git pull brought in the change made on Windows.
From an empty terminal on Windows to a site on GitHub Pages and the project running on the VPS.
Choose a start date and how much time you have each week. The plan spreads out the course's 17 exercises.
About this lesson and the whole step.
Question 1 of 4
Someone asked for your SSH key to "set up access." Which file can you give them?competency
Question 2 of 4
You ran git commit. Is the version on GitHub now?
Question 3 of 4
Before pushing to a public repository, what do you check?
git remote -v, git status, git log --oneline, and no .env file or key. It’s public; anyone can see it.git remote -v, git status, git log --oneline, and no .env file or key. It’s public; anyone can see it.Review: From commit to published pageQuestion 4 of 4
On the VPS, the line starts with root@minha-vps:~#. Where are you?
~ is the home folder; on Windows, the line would start with C:\Users\.~ is the home folder; on Windows, the line would start with C:\Users\.Review: Rehearse: the project on the VPSChoose an option. The explanation appears after your attempt.