How to configure the git server + tortisegit client using copssh in Windows (XP)

Source: Internet
Author: User
Tags ssh server
How to configure the git server + tortisegit client using copssh in Windows (XP)

(Note that you cannot use the puttygen function to save the public key. You must manually copy the public key. Otherwise, the public key cannot be connected)

(Note that you cannot use the puttygen function to save the public key. You must manually copy the public key. Otherwise, the public key cannot be connected)

(Note that you cannot use the puttygen function to save the public key. You must manually copy the public key. Otherwise, the public key cannot be connected)

(Note that you cannot use the puttygen function to save the public key. You must manually copy the public key. Otherwise, the public key cannot be connected)

(Note that you cannot use the puttygen function to save the public key. You must manually copy the public key. Otherwise, the public key cannot be connected)

Recently, I have studied git and found that it is really a good job. However, after trying multiple SSH servers in the configuration of the GIT server, I have never been able to handle it, resulting in a close crash; relying on the idea of "asking Google for foreign affairs and asking Baidu for Internal Affairs", I finally found an e-Article blog. The process is displayed today, hoping to help you. (Note: This article seriously references the following blog posts)

Basic principle: Use copssh to create an SSH server on Windows (XP), use the generated "Public Key-Private Key" pair as the identity, configure the shell script environment on the server, and configure the client, load the private key. The detailed process is as follows:

Preparations before installation:

  1. Downloadcopssh
    [SourceForge link]
    (Note: SSH server software)
  2. Downloadmsysgit
    (Note: git installation package in Windows)
  3. Downloadtortisegit
    (Note: The git graphical software in Windows is the same as tortisesvn)
  4. Downloadputty
    Installer (Note: software that generates a public key-private key pair and can be used for logging on to the SSH client)

Step 1-install copssh

1. Install copssh (Basic edition 2.0.0) to path c: \ SSH

2. Write down the svccopssh password during the installation process. You may never use it, but it is also harmless.

3. start copssh, Select Start> All Programs> copssh> control panel, and activate a user (assumed as administrator, select users> Add. Next, select a user, do not select allow
Password authenticatin option, click forward, OK.

4. You do not need to perform other operations on public keys.

Step 2: Configure copssh

1. Select path-C: \ SSH \ etc, Open in NotepadSsh_configAndSshd_config.(Note: There is a difference between the two files with the letter "D)

2.Ssh_config-Delete the # sign before the port and set the port number. The default port 22 is used here.

3.Sshd_config-Ensure the port number is consistent

4. Check whether the port in the system firewall is disabled. (This is important)

5. restart the system

Step 3-install putty

1. After restarting, continue back. Now you can install putty installer.

2. Navigate to your installation path, usuallyC: \ Program Files \ putty

3.open puttygen.exe

4. Select the length of the generated key to 4096

5. Shake the mouse continuously on the blank Panel (used to generate random seeds) until the generation ends. (Do not disable puttygen)

6. go to the path c: \ SSH \ home \ Administrator \. SSH \ (this path is generated when you use copssh to activate a user. Select the corresponding path based on your activated user name) to create a fileAuthorized_keys
(Note that there is no suffix)

7. Open puttygen and copy the Public Key (Public Key) to the file.Authorized_keys, And save

8. In puttygen, save the private keyPrivate_key.ppk, And save it in the same directory. -For example, my storage directory is c: \ SSH \ home \ Administrator \. Ssh \ private_key.ppk.
9. Now there should be two files in the directory, authorized_keys and private_key.ppk.

10.to test the connection, run putty.exe

11. Enter the IP address (localhost can be used on the local machine) and the port number on the interface.

12. Open the menu on the left, select connection-ssh-auth, and select your private key file, c: \ SSH \ home \ <user> \. Ssh \ private_key.ppk
13. Click Open to open the terminal. You can enter login name and administrator (case sensitive)

14. You will see that your public key is accepted (accept Public Key), the Client Login is successful, and the login information will be cached.

Step 4-install msysgit and tortisegit

1. The next step is to install msysgit. Assume that your path isC: \ msysgit

2. Install tortisegit.

1. Click tortisegit-settings on the right of any website and set the git.exe path to c: \ msysgit \ bin, that is, the msysgit installation path.

2) Select network from the menu on the left, and set SSH clientto plink.exe in putty( for example, my path is c: \ Program Files \ putty \ plink.exe)

3. copy the files required for running git to the directory of the SSH server. After the client is remotely logged on, run these files. The File Source Path is c: \ msysgit.\ Git \ libexec \ Git-core,The files to be copied includeGit.exe, git-receive-pack.exe,
Git-upload-archive.exe
AndGit-upload-pack.exe, Copy the above filesC: \ SSH \ bin

Step 5: configure the user environment

1. For copssh, the default $ home environment isC: \ Documents ents and Settings \ <user>,Git will also searchAuthorized_keysFile. Of course, this is something we should avoid. We need to redirect the GIT pathC: \ SSH \ home \ <user> \. SSH
.

2. Select path C: \ SSH \ home \ Administrator \,Open the. bashrc file and go# User dependent. bashrc FileAdd the following paragraph:Export
Home =/C/ssh/home/Administrator shell options
, (Note that there are no other spaces), and then select Save.

3. copy the file to the user directory, for example:C: \ Documents ents and Settings \ Administrator\

Step 7-use git and plink

1. Open the path c: \ SSH \ home \ administrator and create the folder MyApp. Git.

2. Right-click the folder, select git create repository here, and check make it bare. The Server File Repository is created successfully.

3. navigate to the path c: \ Program Files \ putty, open pageant.exe, select Add key, and load your private key (private_key.ppk.

4. Right-click git clone and set the URLSSH: // administrator@127.0.0.1: 22/ssh/home/Administrator/MyApp. GitIf the clone succeeds, congratulations!

For more information about git operations, see git instructions. Here we recommend pro git Simplified Chinese version. The translation is good.

Note: An error may be reported when running git clone (this error is not mentioned in the reference E text, so it is harmless ), if it is an error about a DLL file (which file cannot be remembered, you can search for it in the msysigt directory based on the file name), you can copy the file to the same directory.C: \ SSH \ binAnd then it can run normally.

 

Category:
Version Control green channel: Follow me to add this article to favorites and contact yinner
Follow-1
Fans-0 + + + follow 00 (please comment on the article) «previous blog: how to use GitHub

Posted on
Yinner reading (3274)
Comment (9)
Edit favorites

Comment

2216068

# View the reply reference on the first floor

I couldn't think of anything I tried the other day. Today I saw you in the garden.

First, like copssh.
If OpenSSH for win is used in Windows 7, it will not work. (The Administrator has tried to execute the command and the compatibility mode. The service can be started but cannot be connected)

The article mentioned that the GIT repository must be in the copssh home directory, instead of using link. It is incorrect. You can use link or Win XP to install something.

Git-receive-pack and so on, as long as you put the server-side msysgit \ cmd directory
And you only need Echo XXX> Git-receive-pack.

The putty that generates the key does not need to be installed. tortoisegit (SVN) will have

Git clone does not report errors or copy files

The URL value during git clone remains to be studied.
Git clone SSH: // username @ xx
Git clone username @ xx
I tried to add SSH: // an error will be reported

SSH protocol selection in eclipse jgit (current version) also reports an error. Once selected, it cannot be paid off.
SSH directly does not select the protocol.

How much are you discussing on QQ?

|
Ddatsh # view the reply reference on the second floor

In addition
Git-receive-pack can be done with link, and copy is not needed.

|
Ddatsh # On the third floor [] Reply to reference to view

I am not familiar with Unix-related operations, so I will refer to them all the way. According to my own understanding, e should be a method, not a standard answer, but there is indeed a feasible solution.

|
Yinner # 4th floor reply reference View

Just do it.
:)

|
Ddatsh # view the reply reference on the 5th floor

Hello, first of all, thank you very much for your information. I would like to ask you a question. I have tried your method many times, but there will be problems in step 3 every time. When we test the connection and run putty.exe, a dialog box is displayed, showing network error: Connection refused. I checked a lot of relevant information but it still didn't work. I 'd like to ask you how to solve it. Thank you!

|
Silverlightcode #6 floor [main poster] Reply to reference to view

@ Silverlightcode
The specific system environment is different, and the problems encountered are very different. Sorry, I cannot give you specific suggestions. I suggest you refer to the E-document link I have provided! The above is more detailed than mine to see if it can solve your problem.

|
Yinner # reply to reference on the 7th floor

Hello, I have installed copssh and putty according to the steps in your blog, activated svccopssh account, and tested the connection,
Login as: svccopssh
Server refused our key
Svccopssh @ localhost's password:
Access denied
Svccopssh @ localhost's password:
Can you tell me why?
I also tried to activate the Administrator, and the results were the same.
Thank you.

|
Codesilverlight # [] Reply to reference on the 8th floor

@ Codesilverlight
Note: 1. Whether the firewall is disabled; 2. Whether the username is case sensitive when using Putty to log on

|
Yinner #9 Floor reply reference View

Hello, LZ. Have you ever performed a test in Windows 2008?
Each time I log in, the permission issue occurs:
Permission denied, please try again.

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.