aws ec2安装git服务器



我尝试设置git服务器AWS-EC2 AMI ubuntu-16.4登录为: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位

$ssh-keygen
$cat ~/.ssh/id_rsa.pub | ssh  ubuntu@public ip "cat >> /home/ubuntu/.ssh/authorized_keys"

服务器ubuntu-16.4root@/#cp/home/ubuntu/.ssh/authorized_keys/git/.ssh/aauthorized_keys

客户端:windows7位

$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工作站ubuntu16.04取得了成功请帮我一把。谢谢

请验证公共SSH密钥是否已与您的GIT帐户关联。您可以在您的git帐户中的配置文件设置下验证相同内容

aws ec2 ubuntu-16.4默认的正常帐户ubuntu是一个成功的

最新更新