gpt4 book ai didi

git - aws ec2安装git服务器

转载 作者:太空宇宙 更新时间:2023-11-03 17:05:10 27 4
gpt4 key购买 nike

我尝试设置 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.04root@/#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 是成功的请帮我一下谢谢

最佳答案

能否请您验证公共(public) SSH key 是否已与您的 GIT 帐户相关联。您可以在 git account 中的个人资料设置下进行验证

关于git - aws ec2安装git服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53664406/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com