実現したいこと
WSL2 ubuntu 上でgit と接続したい
前提
使用OS: windows11
WSL2 を使ってubuntuをインストール
発生している問題・エラーメッセージ
閲覧ありがとうございます。
windows11にて、WSL2を使ってubuntuをインストールしました。
その上でgithub と接続する際に
こちらのページ を参考に ssh を用いた鍵認証を登録しました。
PC側、github側で接続設定が終わり
ssh -T git@github.com
で、接続確認をしたところ、長いタイムアウトが発生し
Connection to github.com closed by remote host.
となり、動かない状況です。
もちろんcloneやpullなどのほかのgitコマンドも動いていません。
これはSSH設定がうまくいっていないのでしょうか?
ほかの原因わかる方いらっしゃいますでしょうか・・?
また、ssh git@github.com を入力したところ
PTY allocation request failed on channel 0 Hi <ユーザー名>! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed
と出るので、認証はできていそうなのですが・・・
※追加補足
先ほども色々試していて
自分の別PCから同様の手順で接続を試みたところ、同様にタイムアウトする現象がおきました。
逆に、ubuntuを使わずwindows11でgitのアプリで試したところ、こちらはssh -T git@github.com
が問題なく接続されました。
→ubuntuを使っていると起こりえる現象なのかも・・・と今も探っております。
また、おととい時点で一度cloneに成功しておりまして、本日、gitにつなげようとしたところ
今回の事象にあたってしまった、という経緯があります。
説明不足で大変申し訳ありません。
試したこと
・git 関連の再インストール
・PC本体の再起動
・wsl --shutdownでubuntuの再起動
・ubuntu上でgoogleなどにpingを飛ばし、繋がっていることを確認
・.git/configのURLが合っていることを確認
■ssh -T -vvv git@github.com を投げた際のログのタイムアウト発生する部分までのログです!!
↓↓↓
debug3: Ignored env HOSTTYPE debug3: Ignored env PULSE_SERVER debug3: Ignored env OLDPWD debug3: Ignored env _ debug2: channel 0: request shell confirm 1 debug3: send packet: type 98 debug2: channel_input_open_confirmation: channel 0: callback done debug2: channel 0: open confirm rwindow 32000 rmax 35000 <※追記コメント ここで10分以上のタイムアウトが発生してました> debug3: receive packet: type 80 debug1: client_input_global_request: rtype keepalive@openssh.com want_reply 1 debug3: send packet: type 82 debug3: send packet: type 1 debug1: channel 0: free: client-session, nchannels 1 debug3: channel 0: status: The following connections are open: #0 client-session (t4 r43 i0/0 o0/0 e[write]/0 fd 4/5/6 sock -1 cc -1 io 0x01/0x00) Connection to github.com closed by remote host. Transferred: sent 3164, received 2656 bytes, in 780.3 seconds Bytes per second: sent 4.1, received 3.4 debug1: Exit status -1
すみません、不慣れなもので、足りない情報などあれば
気軽に質問ください。
よろしくお願いいたします。

回答2件
あなたの回答
tips
プレビュー