# エラー: 不正なファイル番号

このエラーは通常、サーバーに接続できなかったことを示します。 よくある原因はファイアウォールとプロキシサーバーです。

リモート Git コマンドや SSH の実行時に、接続がタイムアウトする場合があります:

```shell
$ ssh -vT git@github.com
> OpenSSH_8.1p1, LibreSSL 2.7.3
> debug1: Connecting to github.com [207.97.227.239] port 22.
> debug1: connect to address 207.97.227.239 port 22: Connection timed out
> ssh: connect to host github.com port 22: Connection timed out
> ssh: connect to host github.com port 22: Bad file number
```

## 問題の解決

### HTTPS を使用する

最もシンプルな解決策は、単に SSH を一切回避することです。 多くのファイアウォールやプロキシでは、HTTPS トラフィックを問題なく許可しています。 これを活用するには、使用中の[リモート URL](/ja/enterprise-cloud@latest/get-started/git-basics/about-remote-repositories) を変更します。

```shell
$ git clone https://github.com/USERNAME/REPO-NAME.git
> Cloning into 'reponame'...
> remote: Counting objects: 84, done.
> remote: Compressing objects: 100% (45/45), done.
> remote: Total 84 (delta 43), reused 78 (delta 37)
> Unpacking objects: 100% (84/84), done.
```

### 別のネットワークからテストする

ファイアウォールのない別のネットワークにコンピューターを接続できる場合は、GitHub への SSH 接続をテストしてみることができます。 すべてが正常に機能している場合は、SSH 接続を成功させるためにファイアウォール設定を変更する方法について、ネットワーク管理者に問い合わせてください。

### HTTPS ポートを介して SSH を使用する

HTTPS を使用することができず、ファイアウォール管理者が SSH 接続を許可しない場合は、代わりに [HTTPS ポートを介して SSH を使用](/ja/enterprise-cloud@latest/authentication/troubleshooting-ssh/using-ssh-over-the-https-port)します。

## 参考資料

* [接続問題のトラブルシューティング](/ja/enterprise-cloud@latest/get-started/using-github/troubleshooting-connectivity-problems)