gpt4 book ai didi

ruby-on-rails - 无法将 IP 地址 'xxx' 的 RSA 主机 key 添加到已知主机列表 (/home/webapp/.ssh/known_hosts)

转载 作者:行者123 更新时间:2023-12-05 05:12:31 25 4
gpt4 key购买 nike

我试图在我的 aws 项目中通过 ssh 而不是 hhtps 访问 git。我按照这一步here并添加了 ssh key 。我在日志中收到以下错误。

Failed to add the RSA host key for IP address 'xxx' to the list of known hosts (/home/webapp/.ssh/known_hosts).

我将所有权从 ec2-user 更改为 webapp。现在我有

Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ssh -vT git@github.com

给予

OpenSSH_7.4p1,OpenSSL 1.0.2k-fips 2017 年 1 月 26 日
debug1:读取配置数据/etc/ssh/ssh_config
debug1:/etc/ssh/ssh_config 第 58 行:为 *
应用选项debug1:连接到 github.com [192.30.253.112] 端口 22。
debug1:连接已建立。
debug1: permanently_set_uid: 0/0
debug1: key_load_public: 没有那个文件或目录
debug1: 身份文件/root/.ssh/id_rsa 类型 -1
debug1: key_load_public: 没有那个文件或目录
debug1: 身份文件/root/.ssh/id_rsa-cert 类型 -1
debug1: key_load_public: 没有那个文件或目录
debug1: 身份文件/root/.ssh/id_dsa 类型 -1
debug1: key_load_public: 没有那个文件或目录
debug1: 身份文件/root/.ssh/id_dsa-cert 类型 -1
debug1: key_load_public: 没有那个文件或目录
debug1: 身份文件/root/.ssh/id_ecdsa 类型 -1
debug1: key_load_public: 没有那个文件或目录
debug1: 身份文件/root/.ssh/id_ecdsa-cert 类型 -1
debug1: key_load_public: 没有那个文件或目录
debug1: 身份文件/root/.ssh/id_ed25519 类型 -1
debug1: key_load_public: 没有那个文件或目录
debug1: 身份文件/root/.ssh/id_ed25519-cert type -1
debug1: 为协议(protocol) 2.0 启用兼容模式
debug1: 本地版本字符串 SSH-2.0-OpenSSH_7.4
debug1:远程协议(protocol)版本2.0,远程软件版本babeld-9db747ba
debug1:不匹配:babeld-9db747ba
debug1:向 github.com:22 验证为“git”
debug1: SSH2_MSG_KEXINIT 已发送
debug1: 收到 SSH2_MSG_KEXINIT
debug1: kex: 算法: curve25519-sha256@libssh.org
debug1: kex: 主机 key 算法:rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: curve25519-sha256@libssh.org 需要=64 dh_need=64
debug1: kex: curve25519-sha256@libssh.org 需要=64 dh_need=64
debug1: 期待 SSH2_MSG_KEX_ECDH_REPLY
debug1:服务器主机 key :ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1:主机“github.com”已知并与 RSA 主机 key 匹配。
debug1:在/root/.ssh/known_hosts:1 中找到 key
警告:已将 IP 地址“192.30.253.112”的 RSA 主机 key 永久添加到已知主机列表中。
debug1:在 134217728 个 block 后重新生成 key
debug1: SSH2_MSG_NEWKEYS 已发送
debug1:期待 SSH2_MSG_NEWKEYS
debug1: 收到 SSH2_MSG_NEWKEYS
debug1:在 134217728 个 block 后重新生成 key
debug1: 收到 SSH2_MSG_EXT_INFO
debug1: kex_input_ext_info: server-sig-algs=
debug1: 收到 SSH2_MSG_SERVICE_ACCEPT
debug1:可以继续的身份验证:publickey
debug1:下一个认证方式:publickey
debug1:尝试私钥:/root/.ssh/id_rsadebug1:尝试私钥:/root/.ssh/id_dsa
debug1:尝试私钥:/root/.ssh/id_ecdsa
debug1:尝试私钥:/root/.ssh/id_ed25519
debug1: 没有更多的身份验证方法可以尝试。
权限被拒绝(公钥)。

请帮忙解决

最佳答案

我遇到了同样的问题。对我来说,我没有 known_hosts 文件的写权限。这个命令为我解决了这个问题。chmod 644 ~/.ssh/known_hosts

关于ruby-on-rails - 无法将 IP 地址 'xxx' 的 RSA 主机 key 添加到已知主机列表 (/home/webapp/.ssh/known_hosts),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54494657/

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