安装Cygwin
- 下载 setup.exe
- 打开setup.exe, 选择Install from Internet
- 选择安装Cygwin到C:\cygwin
- 选择存储下载文件的目录为C:\
- 选择下载站点的镜像
- 选择安装以下软件包:
- Net | openssh (不要选成openssl)
- Devel | git
- Devel | git-completion
- Devel | git-gui
- Devel | git-svn (如果需要同时提交到svn)
- Devel | gitk
- Editors | vim
集成Cygwin和Windows Security
- 打开C:\cygwin\Cygwin.bat
-
$ bin/cyglsa-config
Warning: Registering the Cygwin LSA authentication package requires administrator privileges! You also have to reboot the machine to activate the change.
Are you sure you want to continue? (yes/no)
- 选择yes
- 重启Windows
搭建SSH服务器
- 打开C:\cygwin\Cygwin.bat
-
$ ssh-host-config
*** Info: Generating /etc/ssh_host_key
*** Info: Generating /etc/ssh_host_rsa_key
*** Info: Generating /etc/ssh_host_dsa_key
*** Info: Generating /etc/ssh_host_ecdsa_key
*** Info: Creating default /etc/ssh_config file
*** Info: Creating default /etc/sshd_config file
*** Info: Privilege separation is set to yes by default since OpenSSH 3.3.
*** Info: However, this requires a non-privileged account called 'sshd'.
*** Info: For more info on privilege separation read /usr/share/doc/openssh/README.privsep.
*** Query: Should privilege separation be used? (yes/no)
- 选择yes
*** Info: Note that creating a new user requires that the current account have
*** Info: Administrator privileges. Should this script attempt to create a
*** Query: new local account 'sshd'? (yes/no)
- 选择yes
*** Info: Updating /etc/sshd_config file
*** Info: Added ssh to C:\WINDOWS\system32\driversc\services
*** Warning: The following functions require administrator privileges!
*** Query: Do you want to install sshd as a service?
*** Query: (Say "no" if it is already installed as a service) (yes/no)
- 选择yes
*** Query: Enter the value of CYGWIN for the daemon: []
- 输入tty
*** Info: The sshd service has been installed under the LocalSystem
*** Info: account (also known as SYSTEM). To start the service now, call
*** Info: `net start sshd' or `cygrunsrv -S sshd'. Otherwise, it
*** Info: will start automatically after the next reboot.
*** Info: Host configuration finished. Have fun!
- 配置结束,确认端口22可用。启动服务:sc start sshd
允许SSH客户端访问
- 创建一个名为git的用户,设置密码,并确保密码不会过期。
- 在Cygwin Bash中,执行命令: mkpasswd -l -u git >> /etc/passwd
验证下SSH登录
- 打开Cygwin Bash
-
$ ssh git@10.0.2.15
Administrator@china-fe1bdcde5 ~
$ ssh git@10.0.2.15
The authenticity of host '10.0.2.15 (10.0.2.15)' can't be established.
ECDSA key fingerprint is 5d:a6:81:98:43:fa:5a:f6:df:ba:18:b9:a0:76:87:f8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.2.15' (ECDSA) to the list of known hosts.
git@10.0.2.15's password:
Could not chdir to home directory /home/git: No such file or directory
Copying skeleton files.
These files are for the users to personalise their cygwin experience.
They will never be overwritten nor automatically updated.
`./.bashrc' -> `/home/git//.bashrc'
`./.bash_profile' -> `/home/git//.bash_profile'
`./.inputrc' -> `/home/git//.inputrc'
`./.profile' -> `/home/git//.profile'
git@china-fe1bdcde5 ~
$
- 以git用户登录成功
创建SSH密钥, 并使能够通过SSH identity以git用户登录SSH服务器
- 打开Cygwin Bash
-
$ ssh-keygen -t rsa (所有输入都为空,即使用默认配置,密码为空)
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/Administrator/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/Administrator/.ssh/id_rsa.
Your public key has been saved in /home/Administrator/.ssh/id_rsa.pub.
The key fingerprint is:
6a:02:9f:42:99:7c:fe:52:e7:a9:fe:1b:15:1e:70:31 Administrator@china-fe1bdcde5
The key's randomart image is:
+--[ RSA 2048]----+
| . E. |
| o . |
| o |
| . o . o |
| * . S o |
| . = ..... |
| . =.oo.. |
| ..+ o. |
| o+oo. |
+-----------------+
-
$ ssh-copy-id git@10.0.2.15 (输入git用户密码)
$ ssh-copy-id git@10.0.2.15
git@10.0.2.15's password:
Now try logging into the machine, with "ssh 'git@10.0.2.15'", and check in:
~/.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
- 验证下,以git用户登录:ssh git@10.0.2.15
$ ssh git@10.0.2.15
Last login: Sat Jun 11 23:06:14 2011 from china-fe1bdcde5
git@china-fe1bdcde5 ~
$
- 不需要输入密码,即登录成功
安装Gitolite
- 打开Cygwin Bash
- $ cd /tmp
- $ git clone git://github.com/sitaramc/gitolite.git
- $ cd gitolite/src/
- $ ./gl-easy-install git 10.0.2.15 alec (可以单独执行gl-easy-install查看各个参数的意义)
- 根据安装向导一步步完成配置(其中需要配置alec的密码,生成SSH密钥)
- 当走到需要编辑配置文件(用vim编辑)的时候,在开头插入:$ENV{PATH} = "/usr/local/bin:/bin:/usr/bin";,保存并退出(:wq) 如:
# configuration variables for gitolite
$ENV{PATH} = "/usr/local/bin:/bin:/usr/bin";
# PLEASE READ THE DOCUMENTATION BEFORE EDITING OR ASKING QUESTIONS
# ( http://github.com/sitaramc/gitolite/blob/pu/doc/gitolite.rc.mkd )
# ( or http://sitaramc.github.com/gitolite/doc/gitolite.rc.html )
# this file is in perl syntax. However, you do NOT need to know perl to edit
# it; it should be fairly self-explanatory and easy to maintain
- 继续完成安装。当完成安装之后,可以在当前用户的home目录下面看到gitolite-admin目录。
- $ cd ~/gitolite-admin
-
$ git status
Administrator@china-fe1bdcde5 ~/gitolite-admin
$ git status
# On branch master
nothing to commit (working directory clean)
到此整个git server已经安装结束,可以参考Gitolite文档来配置:添加user和repository
分享到:
相关推荐
关于各种可以在Windows Server 2008上架设git服务器的解决方案 一 方案1:copssh + msysgit 这是一个非常简单而且灵活的方式。如果不涉及开发者对项目访问权限的管理问题,这是一个最经济高效的解决方案,具体安装...
可以在Winxp上架设git服务器的解决方案 ...这个方案应该是大多数公司应该采用的版本控制管理系统架设模式(本文不予介绍,相关的安装参见“20100828 以cygwin和gitolite在winxp上安装git服务器.doc”)。
redis for Windows 7.0.7 使用cygwin编译的64位 redis微软官方的版本太旧了,此为我自己使用Cygwin编译的最新版 注意:这不是官方提供的版本
windows平台下cygwin搭建hadoop,不错的资料欢迎下载
cygwin 交叉编译的 coturn 服务器可以在windows 下运行,包含运行脚本可以直接运行。
windows版本的cygwin,可以在windows环境下使用该工具模拟linux环境
在Windows下利用cygwin仿unix环境安装配置Hadoop
本文档详细介绍了如何在Windows上的Cygwin环境上安装Hadoop的详细过程,网上的很多帖子都是有错误的,我在这里总结并修改的部分错误,希望对大家有帮助。
windows下安装Cygwin指南含安装包
内含三个文档,Cygwin+Eclipse搭建Hadoop开发环境、cygwin安装及基本操作方法总结、Hadoop环境搭建及wordcount实例运行,要做这方面工作的人,可以进行参考
Cygwin+Eclipse搭建Hadoop单机开发环境 cygwin安装后文件备份
实际上内核开发团队决定开始开发和使用Git来作为内核开发的版本控制系统的时候,世界开源社区的反对声音不少,最大的理由是Git太艰涩难懂,从Git的内部工作机制来说,的确是这样。但是随着开发的深入,Git的正常使用...
win7(32位)平台下Cygwin+Eclipse搭建Hadoop单机开发环境 Cygwin(32位)的安装 + ssh的配置 离线安装包
详细介绍windows下,下载安装cygwin进行搭建hadoop开发环境过程。
在Windows下用Eclipse+CDT+cygwin搭建GDB调试平台 以下软件均为Windows平台下的版本。 1、 安装JDK,目的是为了Eclipse的运行。 版本是jdk-1_5_0_06-windows-i586-p.exe或更高 ,下载地址...
在Windows上使用Cygwin作为类Unix支撑环境来安装Hadoop, 网上介绍的还是比较多的。 但是我在安装过程中碰到的一些问题, 没有在任何一个可找到的网页中得到全部解决。 例如,我们一开始选择的是Hadoop 1.0.0版本,...
在Windows下本地安装Cygwin,在Windows下本地安装Cygwin
在Windows平台使用Cygwin下载、编译及配置eCos。
Windows下的SSH安装之Cygwin
Win10不需要Cygwin搭建大数据测试环境搭建hive的bin文件(包含官方版本中缺少的cmd文件),完美解决windows环境下配置hive时,找不到hive命令问题