Setting Up SSH Key for Passwordless Git Access in AI Development

Using SSH Keys for Passwordless Git Access
Last time, we registered the running PohangInfo project with Git and connected it to the Forgejo repository.
However, currently, you need to enter your ID and password every time you push to Git.
If there's only one project, this isn't a big issue, but as we start managing multiple projects using Claude Code and MCP, repeatedly entering passwords will become very inconvenient.
This session will show how to create a secure and convenient Git authentication environment using SSH Keys.
Why SSH Is Needed
Currently, Git is connected via HTTPS.
AI Development Server
↓
Git Push
↓
Enter ID
↓
Enter Password
↓
ForgejoThis requires manual login each time, making automation difficult.
With SSH, you can achieve:
AI Development Server
↓
SSH Key Authentication
↓
Forgejo
↓
Automatic AuthenticationOnce registered, you can use Git without entering a password afterward.
HTTPS vs. SSH
HTTPS | SSH |
|---|---|
Enter ID/Password | Automatic SSH Key Authentication |
Hard to automate | Suitable for automation |
Requires login every time | Only initial registration needed |
Good for simple testing | Recommended for professional development |
If you plan to use Claude Code and MCP, SSH is the better option.
Generating an SSH Key
Connect to the AI Development Server (192.168.0.33).
ssh pc@192.168.0.33Generate an SSH Key.
ssh-keygen -t ed25519 -C "tikatika486@gmail.com"Press Enter repeatedly to accept default settings.
If successful, the following files will be created:
![[AI 개발환경 구축 프로젝트] 5강 SSH Key 등록으로 비밀번호 없이 Git 사용하기](/uploads/editor/AI-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-5%EA%B0%95-SSH-Key-%EB%93%B1%EB%A1%9D%EC%9C%BC%EB%A1%9C-%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8-%EC%97%86%EC%9D%B4-Git-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-20260713-da7f08.webp)
~/.ssh/id_ed25519
~/.ssh/id_ed25519.pubViewing the Public Key
Display the generated public key.
cat ~/.ssh/id_ed25519.pubYou'll see a long string like this:
ssh-ed25519 AAAAC3Nz...Copied the entire string.
Registering SSH Key in Forgejo
Log in to Forgejo.
Click your profile in the top right corner.
SettingsSelect this menu option.
Next, select:
SSH / GPG KeysClick the Add Key button.
Enter a descriptive name like AI-DEV in the Title field.
Paste the public key you copied earlier into the Key field.
Save to complete registration.
![[AI 개발환경 구축 프로젝트] 5강 SSH Key 등록으로 비밀번호 없이 Git 사용하기](/uploads/editor/AI-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-5%EA%B0%95-SSH-Key-%EB%93%B1%EB%A1%9D%EC%9C%BC%EB%A1%9C-%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8-%EC%97%86%EC%9D%B4-Git-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-20260713-864306.webp)
![[AI 개발환경 구축 프로젝트] 5강 SSH Key 등록으로 비밀번호 없이 Git 사용하기](/uploads/editor/AI-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-5%EA%B0%95-SSH-Key-%EB%93%B1%EB%A1%9D%EC%9C%BC%EB%A1%9C-%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8-%EC%97%86%EC%9D%B4-Git-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-20260713-183e5c.webp)
Testing SSH Connection
After completing registration, run the following command:
ssh -T git@192.168.0.33 -p 2222The first connection will prompt you with:
Are you sure you want to continue connecting?yesType yes.
If connected successfully, you'll see:
Hi 아스라이!
You've successfully authenticated.![[AI 개발환경 구축 프로젝트] 5강 SSH Key 등록으로 비밀번호 없이 Git 사용하기](/uploads/editor/AI-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-5%EA%B0%95-SSH-Key-%EB%93%B1%EB%A1%9D%EC%9C%BC%EB%A1%9C-%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8-%EC%97%86%EC%9D%B4-Git-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-20260713-705b7b.webp)
Changing the Remote URL
The repository is currently connected via HTTPS.
Check it:
git remote -vYou might see something like this:
http://192.168.0.33:3000/ukulscore/pohanginfo.gitNow switch to SSH.
git remote set-url origin ssh://git@192.168.0.33:2222/ukulscore/pohanginfo.gitVerify the change:
git remote -vIf successful, it will show:
ssh://git@192.168.0.33:2222/ukulscore/pohanginfo.git![[AI 개발환경 구축 프로젝트] 5강 SSH Key 등록으로 비밀번호 없이 Git 사용하기](/uploads/editor/AI-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-5%EA%B0%95-SSH-Key-%EB%93%B1%EB%A1%9D%EC%9C%BC%EB%A1%9C-%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8-%EC%97%86%EC%9D%B4-Git-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-20260713-d99a80.webp)
Testing the Push
To test, modify a README.md file:
sudo vi README.mdCommit the changes:
git add .
git commit -m "SSH Test"
git pushYou can now push without entering an ID or password.
![[AI 개발환경 구축 프로젝트] 5강 SSH Key 등록으로 비밀번호 없이 Git 사용하기](/uploads/editor/AI-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-5%EA%B0%95-SSH-Key-%EB%93%B1%EB%A1%9D%EC%9C%BC%EB%A1%9C-%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8-%EC%97%86%EC%9D%B4-Git-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-20260713-afe2fd.webp)
Verifying SSH Authentication
Double-check the connection:
ssh -T git@192.168.0.33 -p 2222If authenticated successfully, all future Git pushes and pulls will automatically use the SSH Key.
![[AI 개발환경 구축 프로젝트] 5강 SSH Key 등록으로 비밀번호 없이 Git 사용하기](/uploads/editor/AI-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-5%EA%B0%95-SSH-Key-%EB%93%B1%EB%A1%9D%EC%9C%BC%EB%A1%9C-%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8-%EC%97%86%EC%9D%B4-Git-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-20260713-70521a.webp)
Future Development Environment
Your AI development environment now looks like this:
AI Development Server
/home/projects
│
├── pohanginfo
├── blogscore
├── scheduler
└── chordtool
↓
Claude Code
↓
Git Commit
↓
SSH Key Authentication
↓
Forgejo
↓
Pull to Production Server
↓
Service UpdateYou can now freely develop on the AI development server and securely deploy changes via Git.
Benefits of Using SSH
Using SSH Keys offers several advantages:
No need to enter passwords.
Suitable for automation.
Easier integration with Claude Code and MCP.
Faster Git Push/Pull operations.
Higher security.
In AI development environments, SSH is far more efficient than HTTPS.
Summary of This Lesson
This session covered generating an SSH Key and registering it with Forgejo to enable passwordless Git access.
Your AI development server is now securely connected to Git, allowing Claude Code to modify projects without additional authentication steps.
In the AI era, Git and SSH Keys are essential components of any modern development environment.
Next Lesson Preview
AI Development Environment Setup Project - Lesson 6
Installing Claude Code and Setting Up AI Development Environment
In the next session, we'll install Claude Code, connect it to Forgejo projects, and begin developing with AI.
We'll cover:
Claude Pro login
Installing Claude Code
Opening a project
Verifying Git integration
First AI code edit
Basics of using Claude Code
FAQ
Why use SSH instead of HTTPS for Git?
SSH allows passwordless authentication, is better for automation, integrates easily with AI tools like Claude Code and MCP, and offers higher security than HTTPS.
How do I generate an SSH key on my server?
Use the command `ssh-keygen -t ed25519 -C "your_email@example.com"` to create a new SSH key pair. Accept default settings by pressing Enter multiple times.
What is Forgejo?
Forgejo is an open-source Git service similar to GitHub, used for hosting and managing code repositories in development environments.
Korean Source
This article is an English localization of a Korean-language report from BlogScore. Original: [AI 개발환경 구축 프로젝트] 5강 SSH Key 등록으로 비밀번호 없이 Git 사용하기