【问题标题】:aws ec2 install git serveraws ec2 安装 git 服务器
【发布时间】: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


【解决方案1】:

您能否验证公共 SSH 密钥是否已与您的 GIT 帐户相关联。您可以在 git account 的个人资料设置下验证相同的内容

【讨论】:

  • 看起来您已使用默认路径和默认帐户作为 /home/ubuntu/.ssh/authorized_keys 。您可以创建一个新用户并将公钥添加到其 ~/.ssh/authorized_keys 这样做您应该能够使用原始密钥对登录到您的实例
【解决方案2】:

aws ec2 ubuntu-16.04 默认普通账户ubuntu成功

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-03-17
    • 1970-01-01
    • 2021-11-20
    • 2016-04-27
    • 2014-05-13
    • 2013-09-02
    • 2018-06-26
    相关资源
    最近更新 更多