在新的 Centos 机器上做一个 Gitosis 服务器。.搭建失败,不确实配置端口问题。
安装Gitosis
脚本
新建 git 用户并在目录下生成 gitosis
和 repositories
两个目录。
git clone [email protected]:gitosis-admin.git
# 10.207.137.222 内网 ip 且和Gitosis
在一台机器上。
前两步都没有问题,问题在第三步。执行结果后输出
Initialized empty Git repository in /tmp/gitosis-admin/.git/
Connection closed by 10.207.137.222
fatal: The remote end hung up unexpectedly
以下是/etc/ssh/ssh_config
的配置信息
#Host *
# ForwardAgent yes
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
Port 36000
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
Host *
GSSAPIAuthentication yes
# If this option is set to yes then remote X11 clients will have full access
# to the original X11 display. As virtually no X11 client supports the untrusted
# mode correctly we set this to yes.
ForwardX11Trusted yes
# Send locale-related environment variables
SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE
SendEnv XMODIFIERS
端口起在 36000 上。是不是还有一些其它配置没有做好。
需要怎么配置才能让 git clone 成功。
http://stackoverflow.com/questions/5767850/git-on-custom-ssh-port # 没有成功
http://stackoverflow.com/questions/3596260/git-remote-add-with-other-ssh-port # 没有成功
http://serverfault.com/questions/218256/specify-ssh-port-for-git #也没有成功