How to Set Up a Git Server with SSH on Windows

First, install Cygwin from its website., Then install git and OpenSSH packages, either from the links provided or from within Cygwin's setup utility. , Configure OpenSSH: Open cygwin terminal as admin Type in 'ssh-host-config -y' At the end it will...

7 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: install Cygwin from its website.

    When finished, type in 'net start sshd' to start the openssh server. , type 'ssh cyg-server@localhost' to see if you are able to communicate with the server. , Example to do on the other machine:
    Open git bash and check if openssh server is reachable with the command 'ssh cyg_server@cyg_server@ip_adress_of_open_ssh_server'.

    If it asks for your password, then you are all set up.

    Otherwise recheck Part 1 instructions.

    Open git bash inside the repository you want to push. add remote with 'git remote add myRemote ssh://cyg_server@ip_adress_of_open_ssh_server/~/git/remote.git' push with 'git push MyRemote master'
  2. Step 2: Then install git and OpenSSH packages

  3. Step 3: either from the links provided or from within Cygwin's setup utility.

  4. Step 4: Configure OpenSSH: Open cygwin terminal as admin Type in 'ssh-host-config -y' At the end it will create a default user named 'cyg-server' and ask you a new password for that user.

  5. Step 5: Make sure your install is working as follows: Open cygwin terminal as admin Type 'git' to see if git is working.

  6. Step 6: On your other computer

  7. Step 7: you can git ssh the server by specifying 'cyg_server@ip_adress_of_open_ssh_server'.

Detailed Guide

When finished, type in 'net start sshd' to start the openssh server. , type 'ssh cyg-server@localhost' to see if you are able to communicate with the server. , Example to do on the other machine:
Open git bash and check if openssh server is reachable with the command 'ssh cyg_server@cyg_server@ip_adress_of_open_ssh_server'.

If it asks for your password, then you are all set up.

Otherwise recheck Part 1 instructions.

Open git bash inside the repository you want to push. add remote with 'git remote add myRemote ssh://cyg_server@ip_adress_of_open_ssh_server/~/git/remote.git' push with 'git push MyRemote master'

About the Author

A

Anna James

A passionate writer with expertise in practical skills topics. Loves sharing practical knowledge.

94 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: