{"meta":{"title":"SSH 接続をテストする","intro":"SSH キーを設定し、GitHub に追加すると、接続をテストできます。","product":"認証","breadcrumbs":[{"href":"/ja/enterprise-server@3.21/authentication","title":"認証"},{"href":"/ja/enterprise-server@3.21/authentication/connecting-to-github-with-ssh","title":"SSH を使用した接続"},{"href":"/ja/enterprise-server@3.21/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection","title":"SSH 接続をテストする"}],"documentType":"article"},"body":"# SSH 接続をテストする\n\nSSH キーを設定し、GitHub に追加すると、接続をテストできます。\n\nSSH 接続をテストする前に、次のことを済ませておく必要があります。\n\n* [既存の SSH キーを確認する](/ja/enterprise-server@3.21/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)\n* [新しい SSH キーを生成する](/ja/enterprise-server@3.21/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)\n* [新しい SSH キーを GitHub アカウントに追加しました](/ja/enterprise-server@3.21/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)\n\n先立って作成した SSH キーパスフレーズのパスワードを使ってこのアクションを認証する必要があります。 「[SSH キーのパスフレーズを扱う](/ja/enterprise-server@3.21/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases)」を参照してください。\n\nこれらのステップを実行してください：\n\n1. <span class=\"platform-mac\">\\[ターミナル]</span><span class=\"platform-linux\">\\[ターミナル]</span><span class=\"platform-windows\">\\[Git Bash]</span> を開きます。\n\n2. 次のように入力します。\n\n   ```shell copy\n   ssh -T git@HOSTNAME\n   # Attempts to ssh to GitHub\n   ```\n\n   以下のような警告が表示される場合があります:\n\n   ```shell\n   > The authenticity of host 'HOSTNAME (IP ADDRESS)' can't be established.\n   > ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.\n   > Are you sure you want to continue connecting (yes/no)?\n   ```\n\n3. 表示されるメッセージのフィンガープリントが、Enterprise の公開キー フィンガープリントと一致することを確認します。 その場合は、「`yes`」と入力します。\n\n   ```shell\n   > Hi USERNAME! You've successfully authenticated, but GitHub does not\n   > provide shell access.\n   ```\n\n   <div class=\"ghd-tool linux\">\n\n   このエラー メッセージが表示されることがあります。\n\n   ```shell\n   ...\n   Agent admitted failure to sign using the key.\n   debug1: No more authentication methods to try.\n   Permission denied (publickey).\n   ```\n\n   これは、特定の Linux ディストリビューションで生じる既知の問題です。 詳しくは、「[エラー: エージェントが署名の失敗を認めた](/ja/enterprise-server@3.21/authentication/troubleshooting-ssh/error-agent-admitted-failure-to-sign)」をご覧ください。\n\n   </div>\n\n   > \\[!NOTE]\n   > リモート コマンドはコード 1 で終了します。\n\n4. 出力されたメッセージに、あなたのユーザ名が含まれていることを確認します。 \"permission denied\" というメッセージが表示される場合は、「[エラー: アクセス許可の却下 (公開キー)](/ja/enterprise-server@3.21/authentication/troubleshooting-ssh/error-permission-denied-publickey)」を参照してください。"}