【发布时间】:2018-12-07 06:31:01
【问题描述】:
我尝试设置 git 服务器 AWS-EC2 AMI ubuntu-16.04 登录为:ubuntu
ubuntu@~$su
root@~#apt install git-core
root@~#adduser git
root@~#cd /
root@/#mkdir git
root@/#chmod 777 git
root@/#cd git
root@/git#mkdir .ssh
root@/git#git init --bare test.git
root@/git#chown -R git:git test.git
客户端:windows7 git
$ssh-keygen
$cat ~/.ssh/id_rsa.pub | ssh ubuntu@public ip "cat >> /home/ubuntu/.ssh/authorized_keys"
服务器 ubuntu-16.04 root@/#cp /home/ubuntu/.ssh/authorized_keys /git/.ssh/authorized_keys
客户端:windows7 git
$git clone git@public ip:/git/test.git
git@public ip: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
为什么? 我在 VMware 工作站 ubuntu-16.04 是成功的 请帮我一把。谢谢
【问题讨论】:
标签: git amazon-web-services ubuntu