night0721.xyz/content/posts/git-server/index.md
2023-11-19 17:52:39 +00:00

846 B

title date
How to setup git server on a VPS 2023-11-18T01:30:00+00:00
  1. First login to your VPS as root user
useradd -m git
su git
cd
mkdir .ssh && chmod 700 .ssh
touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
  1. Generate SSH key on your local machine
ssh-keygen -t ed25519 -C "your_email@example.com"
cat ~/.ssh/id_ed25519.pub | ssh USER@HOST "cat >> ~/.ssh/authorized_keys"

To have interface for managing your repositories you can use cgit. For more information about setting up git server you can read this articles: git website interface, frotend, tools for git