Windows Server builds Gitblit environment and GitHub multi-user SSH Key Management

Source: Internet
Author: User
Tags ssh config

Because the project needs, to build a git server, by the way, to solve the problem of SSH key, make a note

First, Windows Server Building Gitblit

1. Download Java

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

(First installed JAVA9, start gitblit.cmd error, and replaced by 1.8.1 JDK)

The error is as follows, did not understand 〒▽〒

Java.lang.classcastexception:java.base/jdk.internal.loader.classloaders$appclassloader cannot is cast to java.base/ Java.net.URLClassLoader
At Org.moxie.MxLauncher.addJarFile (mxlauncher.java:170)
At Org.moxie.MxLauncher.main (mxlauncher.java:117)

2. Download Gitblit (1.8.0)

http://gitblit.com/

3. Configure Java Environment variables

Run Java and Javac after you've configured it all right.

4. Configure Gitblit

The configuration file is the Data/defaults.propoerties file in the Gitblit installation directory

Configuration Reference this Blog

The main changes are

Git.repositoriesfolder = git repository directory (e.g. D:/githubfolder)

Server.httpport = HTTP protocol port number

server.httpbindinterface = Server IP Address

5. Running

Start the gitblit.cmd in the Gitblit directory to run, using Installservice.cmd to start the gitblit as a Windows service;

If the operation error, it is recommended to use the directory Gitblit-stop.cmd stop and then restart;

After startup in the browser Input server IP and HTTP port accessible, Default user name admin, password admin:

  

Create a repository here:

  

Once created, you can see that SSH can be used as well as http:

  

To add SSH key through the User center:

  

  

Second, GitHub multi-user SSH Key Management

Use

Ssh-keygen-t rsa-c ' user mailbox '

To generate SSH key, for multiple users, the second step of the command line to enter the file holding SSH key:

SSH key can be unified in the C:\Users\ user name \.ssh directory;

Edit the config file under this directory (not created);

The format is:

Host aliases (such as GITHUB1)
User username
Hostname github.com (This is the real host name)
Preferredauthentications PublicKey
Identityfile the file that holds the public key (such as ~/.ssh/id_rsa)
Identitiesonly Yes

The aliases here correspond to the URLs under Git remote, which can be seen in the config file in the. git directory;

On the left is my SSH config configuration, the right side is two items of. Git/config configuration, you can see the URL and the host alias is one by one corresponding

PS: I wrote this wrong before, and then I never realized ssh submission's finger licking (ー_ー) Dentetsu

Windows Server builds Gitblit environment and GitHub multi-user SSH Key Management

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.