質問するログイン新規登録

質問編集履歴

10

試したことを追記(4/2)

2020/04/02 11:26

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -219,4 +219,42 @@
219
219
  Bytes per second: sent 4.4, received 3.0
220
220
  debug1: Exit status -1
221
221
  ```
222
- このような結果が出力されました。
222
+ このような結果が出力されました。
223
+
224
+ # 4/2追記
225
+ - ホームディレクトリ内の .gitconfig と、エラーが発生する以前にsshでcloneしたリポジトリ内の .git/config の内容を以下に記載しました。
226
+
227
+ ~/.gitconfig
228
+ ```
229
+ [user]
230
+ name = (ユーザー名)
231
+ email = (メールアドレス)
232
+ [color]
233
+ ui = auto
234
+ [core]
235
+ editor = vim
236
+ ```
237
+ (リポジトリ)/.git/config
238
+ ```
239
+ [core]
240
+ repositoryformatversion = 0
241
+ filemode = true
242
+ bare = false
243
+ logallrefupdates = true
244
+ [remote "origin"]
245
+ url = git@github.com:Satumaimo10/my-first-node-js.git
246
+ fetch = +refs/heads/*:refs/remotes/origin/*
247
+ [branch "master"]
248
+ remote = origin
249
+ merge = refs/heads/master
250
+ ```
251
+ - GIT_SSH_COMMAND="ssh -vvv" git clone git@github.com:Satumaimo10/fibonacci.git を実行すると、
252
+
253
+ [https://pastebin.com/sK7Q8PNq](https://pastebin.com/sK7Q8PNq)
254
+
255
+ ここまでの出力が出てから30分ほど止まったのち、
256
+
257
+ [https://pastebin.com/LZULMbau](https://pastebin.com/LZULMbau)
258
+
259
+ このように出力されて終了しました。
260
+ (文字数制限のため、一部内容を外部サイトに記載しました。)

9

-T -vオプションの結果の追記

2020/04/02 11:26

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -162,4 +162,61 @@
162
162
  ```
163
163
  $ ssh -T git@github.com
164
164
  Connection to github.com closed by remote host.
165
- ```
165
+ ```
166
+ また、-T -v オプションを付けて実行すると、
167
+ ```
168
+ $ ssh -vT git@github.com
169
+ OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
170
+ debug1: Reading configuration data /home/(ユーザー名)/.ssh/config
171
+ debug1: /home/(ユーザー名)/.ssh/config line 1: Applying options for github.com
172
+ debug1: Reading configuration data /etc/ssh/ssh_config
173
+ debug1: /etc/ssh/ssh_config line 19: Applying options for *
174
+ debug1: Connecting to github.com [13.114.40.48] port 22.
175
+ debug1: Connection established.
176
+ debug1: identity file /home/(ユーザー名)/.ssh/new_github_rsa type 0
177
+ debug1: key_load_public: No such file or directory
178
+ debug1: identity file /home/(ユーザー名)/.ssh/new_github_rsa-cert type -1
179
+ debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
180
+ debug1: Remote protocol version 2.0, remote software version babeld-2de4da3d
181
+ debug1: no match: babeld-2de4da3d
182
+ debug1: Authenticating to github.com:22 as 'git'
183
+ debug1: SSH2_MSG_KEXINIT sent
184
+ debug1: SSH2_MSG_KEXINIT received
185
+ debug1: kex: algorithm: curve25519-sha256
186
+ debug1: kex: host key algorithm: rsa-sha2-512
187
+ debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
188
+ debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
189
+ debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
190
+ debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
191
+ debug1: Host 'github.com' is known and matches the RSA host key.
192
+ debug1: Found key in /home/(ユーザー名)/.ssh/known_hosts:4
193
+ debug1: rekey after 134217728 blocks
194
+ debug1: SSH2_MSG_NEWKEYS sent
195
+ debug1: expecting SSH2_MSG_NEWKEYS
196
+ debug1: SSH2_MSG_NEWKEYS received
197
+ debug1: rekey after 134217728 blocks
198
+ debug1: SSH2_MSG_EXT_INFO received
199
+ 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>
200
+ debug1: SSH2_MSG_SERVICE_ACCEPT received
201
+ debug1: Authentications that can continue: publickey
202
+ debug1: Next authentication method: publickey
203
+ debug1: Offering public key: RSA SHA256:q1BYo5TGSROxOczENTk/el1aBZs/phEC1eEVhAurE+0 /home/(ユーザー名)/.ssh/new_github_rsa
204
+ debug1: Server accepts key: pkalg ssh-rsa blen 535
205
+ debug1: Authentication succeeded (publickey).
206
+ Authenticated to github.com ([13.114.40.48]:22).
207
+ debug1: channel 0: new [client-session]
208
+ debug1: Entering interactive session.
209
+ debug1: pledge: network
210
+ debug1: Sending environment.
211
+ debug1: Sending env LANG = ja_JP.UTF-8
212
+ ```
213
+ ここで一旦処理が停止したのち、
214
+ ```
215
+ debug1: client_input_global_request: rtype keepalive@openssh.com want_reply 1
216
+ debug1: channel 0: free: client-session, nchannels 1
217
+ Connection to github.com closed by remote host.
218
+ Transferred: sent 3412, received 2308 bytes, in 780.3 seconds
219
+ Bytes per second: sent 4.4, received 3.0
220
+ debug1: Exit status -1
221
+ ```
222
+ このような結果が出力されました。

8

誤字の修正

2020/03/30 04:04

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -158,7 +158,7 @@
158
158
 
159
159
 
160
160
  ```
161
- - 今回の問題と関係あるかは分からないのですが、 -T オプションを付けてssh git@github.comを実行するとcloneしたときと同様に30分ほど止まってからエラーが発生することを確認しました。
161
+ - 今回の問題と関係あるかは分からないのですが、 -T オプションを付けてssh git@github.comを実行するとcloneしたときと同様に30分ほど止まってからエラーが発生することを確認しました。
162
162
  ```
163
163
  $ ssh -T git@github.com
164
164
  Connection to github.com closed by remote host.

7

追記内容の修正

2020/03/29 15:40

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -158,7 +158,7 @@
158
158
 
159
159
 
160
160
  ```
161
- - -T オプションを付けてssh git@github.comを実行すると、cloneしたときと同様に30分ほど止まってからエラーが発生することを確認しました。
161
+ - 今回の問題と関係あるかは分からないのですが、 -T オプションを付けてssh git@github.comを実行すると、cloneしたときと同様に30分ほど止まってからエラーが発生することを確認しました。
162
162
  ```
163
163
  $ ssh -T git@github.com
164
164
  Connection to github.com closed by remote host.

6

試したことを追記(2回目)

2020/03/29 15:39

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -98,4 +98,68 @@
98
98
  HostName github.com
99
99
  User git
100
100
  IdentityFile "~/.ssh/new_github_rsa"
101
+ ```
102
+
103
+ #3/30追記
104
+ - ssh git@github.com -v の出力結果を以下に記載しました。
105
+ ```
106
+ $ ssh git@github.com -v
107
+ OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
108
+ debug1: Reading configuration data /home/(ユーザー名)/.ssh/config
109
+ debug1: /home/(ユーザー名)/.ssh/config line 1: Applying options for github.com
110
+ debug1: Reading configuration data /etc/ssh/ssh_config
111
+ debug1: /etc/ssh/ssh_config line 19: Applying options for *
112
+ debug1: Connecting to github.com [52.69.186.44] port 22.
113
+ debug1: Connection established.
114
+ debug1: identity file /home/(ユーザー名)/.ssh/new_github_rsa type 0
115
+ debug1: key_load_public: No such file or directory
116
+ debug1: identity file /home/(ユーザー名)/.ssh/new_github_rsa-cert type -1
117
+ debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
118
+ debug1: Remote protocol version 2.0, remote software version babeld-2de4da3d
119
+ debug1: no match: babeld-2de4da3d
120
+ debug1: Authenticating to github.com:22 as 'git'
121
+ debug1: SSH2_MSG_KEXINIT sent
122
+ debug1: SSH2_MSG_KEXINIT received
123
+ debug1: kex: algorithm: curve25519-sha256
124
+ debug1: kex: host key algorithm: rsa-sha2-512
125
+ debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
126
+ debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
127
+ debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
128
+ debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
129
+ debug1: Host 'github.com' is known and matches the RSA host key.
130
+ debug1: Found key in /home/(ユーザー名)/.ssh/known_hosts:4
131
+ debug1: rekey after 134217728 blocks
132
+ debug1: SSH2_MSG_NEWKEYS sent
133
+ debug1: expecting SSH2_MSG_NEWKEYS
134
+ debug1: SSH2_MSG_NEWKEYS received
135
+ debug1: rekey after 134217728 blocks
136
+ debug1: SSH2_MSG_EXT_INFO received
137
+ 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>
138
+ debug1: SSH2_MSG_SERVICE_ACCEPT received
139
+ debug1: Authentications that can continue: publickey
140
+ debug1: Next authentication method: publickey
141
+ debug1: Offering public key: RSA SHA256:q1BYo5TGSROxOczENTk/el1aBZs/phEC1eEVhAurE+0 /home/(ユーザー名)/.ssh/new_github_rsa
142
+ debug1: Server accepts key: pkalg ssh-rsa blen 535
143
+ debug1: Authentication succeeded (publickey).
144
+ Authenticated to github.com ([52.69.186.44]:22).
145
+ debug1: channel 0: new [client-session]
146
+ debug1: Entering interactive session.
147
+ debug1: pledge: network
148
+ debug1: Sending environment.
149
+ debug1: Sending env LANG = ja_JP.UTF-8
150
+ PTY allocation request failed on channel 0
151
+ debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
152
+ Hi Satumaimo10! You've successfully authenticated, but GitHub does not provide shell access.
153
+ debug1: channel 0: free: client-session, nchannels 1
154
+ Connection to github.com closed.
155
+ Transferred: sent 3752, received 2504 bytes, in 0.4 seconds
156
+ Bytes per second: sent 10532.7, received 7029.3
157
+ debug1: Exit status 1
158
+
159
+
160
+ ```
161
+ - -T オプションを付けてssh git@github.comを実行すると、cloneしたときと同様に30分ほど止まってからエラーが発生することを確認しました。
162
+ ```
163
+ $ ssh -T git@github.com
164
+ Connection to github.com closed by remote host.
101
165
  ```

5

リンクの再度修正

2020/03/29 15:32

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -61,7 +61,7 @@
61
61
 
62
62
  # 3/28追記
63
63
  - gitの再インストール、Ubuntuおよびgitの別アカウントからのcloneを試したが上手く行かなかった。
64
- - <https://stackoverflow.com/questions/26352189/ssh-github-works-but-not-git-push> を参考に ~/.ssh/config を以下のように設定したが、変化はなかった。 
64
+ - [https://stackoverflow.com/questions/26352189/ssh-github-works-but-not-git-push](https://stackoverflow.com/questions/26352189/ssh-github-works-but-not-git-push) を参考に ~/.ssh/config を以下のように設定したが、変化はなかった。 
65
65
  ```
66
66
  Host github.com github
67
67
  HostName github.com
@@ -85,7 +85,7 @@
85
85
  ```
86
86
  同様のエラーが出力された。
87
87
 
88
- - <https://help.github.com/ja/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account> を参考に、
88
+ - [https://help.github.com/ja/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account](https://help.github.com/ja/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account) を参考に、
89
89
  以下のように鍵を作り直してみたが、cloneを実行したところ同様のエラーが発生した。
90
90
  ```
91
91
  ssh-keygen -f "new_github_rsa" -t rsa -b 4096 -C "(メールアドレス)"

4

リンクの修正

2020/03/28 04:16

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -61,7 +61,7 @@
61
61
 
62
62
  # 3/28追記
63
63
  - gitの再インストール、Ubuntuおよびgitの別アカウントからのcloneを試したが上手く行かなかった。
64
- - https://stackoverflow.com/questions/26352189/ssh-github-works-but-not-git-push を参考に ~/.ssh/config を以下のように設定したが、変化はなかった。 
64
+ - <https://stackoverflow.com/questions/26352189/ssh-github-works-but-not-git-push> を参考に ~/.ssh/config を以下のように設定したが、変化はなかった。 
65
65
  ```
66
66
  Host github.com github
67
67
  HostName github.com
@@ -85,7 +85,7 @@
85
85
  ```
86
86
  同様のエラーが出力された。
87
87
 
88
- - https://help.github.com/ja/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account を参考に、
88
+ - <https://help.github.com/ja/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account> を参考に、
89
89
  以下のように鍵を作り直してみたが、cloneを実行したところ同様のエラーが発生した。
90
90
  ```
91
91
  ssh-keygen -f "new_github_rsa" -t rsa -b 4096 -C "(メールアドレス)"

3

追記内容の一部修正

2020/03/28 04:15

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -89,6 +89,9 @@
89
89
  以下のように鍵を作り直してみたが、cloneを実行したところ同様のエラーが発生した。
90
90
  ```
91
91
  ssh-keygen -f "new_github_rsa" -t rsa -b 4096 -C "(メールアドレス)"
92
+ eval "$(ssh-agent -s)"
93
+ ssh-add ~/.ssh/new_github_rsa
94
+
92
95
  ```
93
96
  ```
94
97
  Host github.com github

2

試したことを追記

2020/03/28 04:09

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
File without changes
body CHANGED
@@ -57,4 +57,42 @@
57
57
  ### 補足情報
58
58
  Ubuntu 18.04.4 LTS
59
59
 
60
- git version 2.17.1
60
+ git version 2.17.1
61
+
62
+ # 3/28追記
63
+ - gitの再インストール、Ubuntuおよびgitの別アカウントからのcloneを試したが上手く行かなかった。
64
+ - https://stackoverflow.com/questions/26352189/ssh-github-works-but-not-git-push を参考に ~/.ssh/config を以下のように設定したが、変化はなかった。 
65
+ ```
66
+ Host github.com github
67
+ HostName github.com
68
+ User git
69
+ IdentityFile "~/.ssh/id_github_rsa"
70
+ ```
71
+ - GIT_TRACE=true で接続したところ、
72
+ ```
73
+ $ GIT_TRACE=true git clone git@github.com:Satumaimo10/fibonacci.git
74
+ 11:01:25.182599 git.c:344 trace: built-in: git clone git@github.com:Satumaimo10/fibonacci.git
75
+ Cloning into 'fibonacci'...
76
+ 11:01:25.184874 run-command.c:646 trace: run_command: unset GIT_DIR; ssh git@github.com 'git-upload-pack '\''Satumaimo10/fibonacci.git'\'''
77
+ ```
78
+ 上記の出力が出てから30分ほど経過したのち、
79
+ ```
80
+ Connection to github.com closed by remote host.
81
+ fatal: Could not read from remote repository.
82
+
83
+ Please make sure you have the correct access rights
84
+ and the repository exists.
85
+ ```
86
+ 同様のエラーが出力された。
87
+
88
+ - https://help.github.com/ja/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account を参考に、
89
+ 以下のように鍵を作り直してみたが、cloneを実行したところ同様のエラーが発生した。
90
+ ```
91
+ ssh-keygen -f "new_github_rsa" -t rsa -b 4096 -C "(メールアドレス)"
92
+ ```
93
+ ```
94
+ Host github.com github
95
+ HostName github.com
96
+ User git
97
+ IdentityFile "~/.ssh/new_github_rsa"
98
+ ```

1

タイトル、内容の一部修正

2020/03/28 04:05

投稿

Satumaimo10
Satumaimo10

スコア6

title CHANGED
@@ -1,1 +1,1 @@
1
- 【git】sshでcloneしようとするとエラーになる
1
+ 【git】sshでcloneするとエラーになる
body CHANGED
@@ -51,7 +51,7 @@
51
51
  ```
52
52
 
53
53
  自分の調べた範囲では同様の症状が見つからず、ご質問させて頂きました。
54
- 原因わかる方がいましたら、ご回答頂けると幸いです。
54
+ エラーの原因についてわかる方がいましたら、ご回答頂けると幸いです。
55
55
 
56
56
 
57
57
  ### 補足情報