Build an SSH-based git server under Windows

Source: Internet
Author: User
Tags git client ssh server

Git client Installation

The client is installed on both the remote server and its own computer: http://msysgit.github.io/

Select Installation components: You can also choose by default;

    • Icon Component (addition icons): Choose whether to create a Quick Launch bar icon or whether to create a desktop shortcut;
    • Desktop Browsing (Windows Explorer integration): The way to browse the source code, a separate context browser only using bash or git GUI tools only; Advanced contextual browsing methods using the Git-cheetah plugin plugin;
    • Association profile: Whether to associate a git configuration file that mainly displays the style of the text editor;
    • Associated shell script file: whether to associate a script file executed by the bash command line;
    • Use TrueType encoding: whether to use Truthtype encoding at the command line, which is a generic encoding developed by Microsoft and Apple;

Set environment variables: choose what command-line tool to use, in general we use GIT bash by default, the default choice;

    • Git comes with: git bash command-line tool with Git;
    • System comes with cmd: command-line tool using Windows system;
    • Both are: The above two are configured at the same time, but note that this will cover the Windows Find.exe and Sort.exe tools, if not understand these try not to choose;

Select a line break format:

    • Check out the conversion of Windows format to UNIX format: line wrapping in Windows format to UNIX format is committed;
    • Check out the original format to UNIX format: No matter what format, all into the UNIX format of the line to commit;
    • No format conversions: Do not convert, check out what, just commit what;

Installing COPSHH

This software is installed on the remote server, be careful not to use the default program files under the installation path, and do not have spaces in the path, otherwise it will cause unnecessary trouble to cause failure, for example, I installed in the C:\SSH. Download: http://download.csdn.net/detail/narutoboygg/8379851

The installation process creates a service named Svccopssh, which is used by the system user to start the copssh, which, by default, reminds you that if you unload the load Copssh Remember to manually delete the system user svccopssh (Windows user), Otherwise the COPSSH service will not start properly.

Configure COPSHH

To open Copshh from the Start menu:

You should see the service in a running state:

Then add a user to Windows and select the user below.

Select the Windows shell type to remove the password authentication:

Click Keys to create the access key for the user:

Click the Add button

Set the access password corresponding to the key and the saved name

Under the C:\SSH\home directory, locate the Uiadmin folder, and add the permissions that the system user has full control over (the user selected above).

Click the Forward button on the previous step to complete the creation of the key file.

The generated private key file UIADMINKEY.PPK, the corresponding Authorized_keys has been automatically generated in the c:\ssh\home\< user name >\.ssh directory

Configure Git to SSH Server

Copy a few necessary files into the C:\SSH\bin

Copy Git.exe, Git-receive-pack.exe, Git-upload-archive.exe,git-upload-pack.exe from the \libexec\git-core folder under the GIT installation directory to C # Ssh\bin

Copy the \bin\libiconv-2.dll from the GIT installation directory to C:\SSH\bin.

Create a git repository

Come to c:\ssh\home\< user name >\ folder, create a new folder as a Git repository, for example C:\SSH\home\UIAdmin\UICode

Through Client access

When a client clones code by URL, such as ssh://< username >@127.0.0.1:22/SSH/home/< user name >/uiadmin

Build an SSH-based git server under Windows

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.