目的
EC2環境でデプロイするため自身がGitHubにアップしているWebアプリケーションをクローンしようとしています。
以下を参考にさせて頂いてしてデプロイを進めていました。
(デプロイ編①)世界一丁寧なAWS解説。EC2を利用して、RailsアプリをAWSにあげるまで
問題
AWSのEC2でgit cloneをしたところ以下のようなエラーが出てクローンができません。
[anyone@ip-10-0-0-82 ~]$ git clone git@github.com:anyone/app.git Cloning into 'app'... ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
試したこと
参照:git cloneしたらERROR: Repository not found.
- ssh鍵の再登録は変化なし。
- ユーザーの名前は想定どおり。
ssh -v -T git@github.com
のログにdebug1: key_load_public: No such file or directory
があり公開鍵を探せていないように見える。
/home/anyone/.ssh/configを読み取って欲しいのですが、どうやら/etc/ssh/ssh_configを読み取っているみたいです。cloneコマンドを実行したのは/home/anyone/var/www/railsです。なぜ/home/anyone/.ssh/configを読み込んでしまうかよくわからない状態です。
.ssh/config
Host github Hostname github.com User git IdentityFile ~/.ssh/aws_git_rsa
[anyone@ip-10-0-0-82 rails]$ ssh -v -T git@github.com OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 debug1: Reading configuration data /home/anyone/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 58: Applying options for * 140.82.114.4 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaadebug1: Connecting to github.com [192.30.253.112] port 22. debug1: Connection established. debug1: key_load_public: No such file or directory debug1: identity file /home/anyone/.ssh/id_rsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/anyone/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/anyone/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/anyone/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/anyone/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/anyone/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/anyone/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/anyone/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.4 debug1: Remote protocol version 2.0, remote software version babeld-93408c70 debug1: no match: babeld-93408c70 debug1: Authenticating to github.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: rsa-sha2-512 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: curve25519-sha256 need=64 dh_need=64 debug1: kex: curve25519-sha256 need=64 dh_need=64 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 debug1: Host 'github.com' is known and matches the RSA host key. debug1: Found key in /home/naoki/.ssh/known_hosts:4 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey after 134217728 blocks debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/naoki/.ssh/aws_git_rsa debug1: Server accepts key: pkalg ssh-rsa blen 279 debug1: Authentication succeeded (publickey). Authenticated to github.com ([192.30.253.112]:22). debug1: channel 0: new [client-session] debug1: Entering interactive session. debug1: pledge: network debug1: Sending environment. debug1: Sending env LANG = ja_JP.UTF-8 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 Hi Seiya-Takada! You've successfully authenticated, but GitHub does not provide shell access. debug1: channel 0: free: client-session, nchannels 1 Transferred: sent 2788, received 2228 bytes, in 0.1 seconds Bytes per second: sent 38835.5, received 31035.0 debug1: Exit status 1
###その他試したこと
2.GitHub公式サイトを参照:Error: Repository not found
- git@~/.gitの部分はコピペのため問題なし。
- 権限について、自身のリポジトリを使っています。
- SSH接続について、ssh -T githubで確認したところ問題はありませんでした。
- リポジトリは確かに存在しています。
[anyone@ip-10-0-0-82 ~]$ ssh -T github Hi anyone! You've successfully authenticated, but GitHub does not provide shell access.
3.鍵のアクセス権について
[anyone@ip-10-0-0-82 .ssh]$ ls -l 合計 20 -rw------- 1 naoki naoki 418 7月 3 03:45 authorized_keys -rw------- 1 naoki naoki 1675 7月 3 20:48 aws_git_rsa -rw-r--r-- 1 naoki naoki 427 7月 3 20:48 aws_git_rsa.pub -rw------- 1 naoki naoki 79 7月 4 03:29 config -rw-r--r-- 1 naoki naoki 2379 7月 3 21:16 known_hosts
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/07/04 05:48
2019/07/04 06:01
退会済みユーザー
2019/07/04 06:39