[英]Setting up git-core, gitolite and gitweb in ubuntu 12.04 and adding a windows machine as git client isn't working
我正在使用此链接在 ubuntu 12.04 中安装 git-core、gitolite 和 gitweb:
https://ao2.it/wiki/How_to_setup_a_GIT_server_with_gitolite_and_gitweb
我使用以下命令安装了git-core
:
sudo apt-get install git-core
然后我使用以下命令添加了一个新用户git
:
sudo adduser \
--system \
--shell /bin/bash \
--gecos 'git SCM user' \
--group \
--disabled-password \
--home /home/git \
git
然后我在/home/git
添加了存储库
sudo -u git mkdir /home/git/repositories
然后我移动到 Windows 机器,并使用以下命令生成pub
和ppk
密钥:
ssh-keygen -t rsa
然后我将pub
密钥复制到 ubuntu 并将其添加到/home/<username>/.ssh/
文件夹。
然后我在 windows cmd
运行scp
命令:
scp C:/Users/Ajay Kulkarni-enEXL/.ssh/id_rsa.pub 192.168.1.140:git.pub
git
是我之前在 Ubuntu 中创建的新用户名。
该命令的输出是:
You can't hack this system from external connectors like putty telnet etc.!!
Good luck with hacking this system cheers :)
Ajay Kulkarni-enEXL@192.168.1.140's password:
Permission denied, please try again.
Ajay Kulkarni-enEXL@192.168.1.140's password:
Permission denied, please try again.
Ajay Kulkarni-enEXL@192.168.1.140's password:
Permission denied (publickey,password).
lost connection
我得到了这个堆栈转储:
Exception: STATUS_ACCESS_VIOLATION at eip=61050C17
eax=00000000 ebx=616D16C8 ecx=0000000B edx=00000000 esi=0028E870 edi=002F0028
ebp=0028E708 esp=0028E6E0 program=C:\Program Files (x86)\OpenSSH\bin\ssh.exe, pid 6924, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function Args
0028E708 61050C17 (616D16C8, 00000001, 0028E870, 00000001)
0028E768 610A341F (00000004, 00000001, 0028E870, 00000020)
0028E8B8 6108DF2F (0028ED10, 0028E8D0, 00000400, 00000002)
0028ECE8 00428777 (0028ED10, 00000000, 004104F5, 100E8C78)
0028EDB8 0041058A (0028EE20, 0000004F, 00000000, 0028EE34)
0028EDD8 0040FD53 (0028EE20, 100EF838, 0028EE20, 0041B469)
0028EE08 0041AA08 (00000000, 0028EE34, 0028EE20, 0040F7A4)
0028EE68 0040FBD8 (100E8C60, 100E8C78, 100E8C48, 004391B0)
0028F038 004023A0 (00000001, 616D2744, 100E00A8, 0028F090)
0028F078 61005F54 (0028F090, 00570056, 00590058, 007B005A)
0028FF58 6100616B (00000000, 00000000, 00000000, 00000000)
End of stack trace
scp
无法连接到 ubuntu 实例。 如何让scp
连接到 ubuntu?
然后我将 pub 密钥复制到 ubuntu 并将其添加到
/home/<username>/.ssh/
文件夹
您实际上需要将它添加到/home/git/.ssh/authorized_keys
(具有正确的权限,如此处所见
server$ mkdir ~/.ssh
server$ chmod 700 ~/.ssh
server$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
server$ chmod 600 ~/.ssh/authorized_keys
server$ rm ~/id_rsa.pub
)。
测试您的 ssh 连接
ssh -Tv git@192.168.1.140
在继续之前,您必须能够以git
身份打开ssh
会话。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.