【问题标题】:(ECDSA) to the list of known hosts. fatal: could not read Username for 'https://github.com': No such device or address(ECDSA) 到已知主机列表。致命:无法读取“https://github.com”的用户名:没有这样的设备或地址
【发布时间】:2017-05-28 09:30:11
【问题描述】:

我已经在 Repository 下的 codeship 中配置了 github 存储库,并在 Deployment 下添加了分支。还有

BRANCH_NAME="${CI_BRANCH}"
ROOT_FOLDER="/home/ubuntu/code"
EC2_SERVER="blah@blah.compute.amazonaws.com"
fetch_branch="cd $ROOT_FOLDER && git fetch origin" && echo $fetch_branch
ssh $EC2_SERVER $fetch_branch
pull_branch="cd $ROOT_FOLDER && git checkout $BRANCH_NAME && git pull
origin $BRANCH_NAME" && echo $pull_branch
ssh $EC2_SERVER $pull_branch
ssh $EC2_SERVER "rsync -rvI $ROOT_FOLDER/ /home/ubuntu/www/code/"

但我在部署时发现 Codeship 出现以下错误。

【问题讨论】:

    标签: git github amazon-ec2 codeship


    【解决方案1】:

    known_host 部分是一条“信息”消息:它通知您您的 ~/.ssh/known_hosts 现在列出了您的远程 aws 实例。
    这不是阻塞。

    但是如果你想在远程服务器上打开一个 ssh 会话,你需要将你的 ~/.ssh/id_rsa.pub 公钥添加到远程服务器的 ~blah/.ssh/authorized_keys 文件中。

    参见“Amazon EC2 Key Pairs”或“SSH Connections to AWS CodeCommit”,它们都描述了相同的原理。


    “致命:无法读取 http 的用户名...”意味着它需要知道哪个用户正在访问 GitHub 存储库。

    cd /path/to/aws/repo
    git remote set-url origin https://{username}:{password}@github.com/{username}/project.git
    

    这不是很安全,因为您的密码是网址的一部分。
    最好是use a credential manager 来缓存所说的密码(如illustrated here)。
    或者使用ssh url for that repo

    【讨论】:

    • 对不起,我已经解决了那个错误信息,但忘记更新 codeship 的错误信息了。我已经编辑了我的问题,请让我知道如何解决它。谢谢。
    猜你喜欢
    • 2013-09-24
    • 1970-01-01
    • 2019-06-24
    • 1970-01-01
    • 2013-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-09
    相关资源
    最近更新 更多