[MEMO] The steps to run your own secured git repository
1. Create user "git"
adduser git
2. Plant public key to /home/git/.ssh/authorized_keys
ssh-keygen -t rsa
3. Create bare repository
cd /home/git
mkdir git-test.git
cd git-test.git
git init --bare
4. Download plink.exe and pagent.exe
- Run pagent
- Add private key to pagent (click the small tray icon)
Set GIT_SSH env var in local
GIT_SSH={your path to plink.exe}
Prepare client repository
mkdir git-test
git init
git add .
git commit -m "initial commit"
git remote add origin ssh://git@14.199.45.48/home/git/git-test.git
git push origin master
adduser git
2. Plant public key to /home/git/.ssh/authorized_keys
ssh-keygen -t rsa
3. Create bare repository
cd /home/git
mkdir git-test.git
cd git-test.git
git init --bare
4. Download plink.exe and pagent.exe
- Run pagent
- Add private key to pagent (click the small tray icon)
Set GIT_SSH env var in local
GIT_SSH={your path to plink.exe}
Prepare client repository
mkdir git-test
git init
git add .
git commit -m "initial commit"
git remote add origin ssh://git@14.199.45.48/home/git/git-test.git
git push origin master
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home