# SSH 構成を作成する

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/go/llms.txt).

> **TL;DR**
> 必要なプラグイン：  FTP/SFTP/WebDAV Connectivity （バンドル済み）

ホスト、ポート、ユーザー名、認証設定を SSH 構成に保存します。 [SFTP ファイル転送](creating-a-remote-server-configuration.html)や [SSH ターミナルセッション](running-ssh-terminal.html)で再利用します。

Procedure:

1. 設定   ダイアログ（ `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Comma` (VSCode), `⌘ Comma` (VSCode (macOS)) ）で  `ツール | SSH 構成`  に移動します。

2. 左側のペインで、 ![項目を追加](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) をクリックします。

3. このプロジェクトでのみ表示する   チェックボックスを使用して、このサーバーアクセス構成を他のプロジェクトで再利用できるようにします。

* チェックボックスを選択して、SSH 構成の使用を現在のプロジェクトに制限します。 このような SSH 構成は、現在のプロジェクト以外では再利用できません。 他のプロジェクトで使用可能な構成の一覧には表示されません。 プロジェクト固有の構成は、 `.idea` ディレクトリに保存されます。 これらのファイルを [バージョン管理経由で](version-control-integration.html)共有する前に確認してください。 すべてのプロジェクトで利用可能なサーバー構成は、IDE 設定に保存されます。

* チェックボックスがオフの場合、SSH 構成はすべての GoLand プロジェクトで表示されます。 その設定は、複数のプロジェクトで再利用できます。

4. ホスト   、   ユーザー名   、   ポート   フィールドで、接続パラメーターを指定します。

5. サーバーへの認証方法を選択します。 次のいずれかを実行します：

* パスワード : パスワードを使用してホストにアクセスします。 GoLand にパスワードを保存するには、 パスワードを保存 チェックボックスを選択します。

* キーペア (OpenSSH または PuTTY) : キーペアで [SSH 認証(英語)](https://www.ssh.com/)を使用します。 この認証方法を適用するには、クライアントマシンに秘密鍵があり、リモートサーバーに公開鍵が必要です。 GoLand は、 [OpenSSH](https://www.openssh.com/) ユーティリティで生成された秘密鍵をサポートしています。 秘密鍵 が保存されているファイルへのパスを指定し、パスフレーズ (存在する場合) を対応するフィールドに入力します。 GoLand にパスフレーズを記憶させるには、 パスフレーズを保存 チェックボックスを選択します。

* OpenSSH 構成および認証エージェント : [ssh-agent(英語)](https://en.wikipedia.org/wiki/Ssh-agent) や [Pageant (Windows のみ)(英語)](https://the.earth.li/~sgtatham/putty/0.70/htmldoc/Chapter9.html#pageant) など、SSH キーを管理する資格情報ヘルパーアプリケーションを使用します。 > **Tip:** > OpenSSH ssh-agent と Pageant の両方を実行している場合は、キーが含まれていない場合でも ssh-agent のみが使用されます。

SSH キーの使用方法の詳細については、 [新しい SSH 鍵を生成して ssh-agent に追加する(英語)](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)チュートリアルを参照してください。

6. 接続のテスト   ボタンをクリックして、設定が正しく、GoLand がターゲットサーバーに接続できることを確認します。

> **Note:**
> 作成した SSH サーバー構成は、まだ  [デプロイサーバー構成](deploying-applications.html) ではありません。 アプリケーションをリモート SSH サーバーにデプロイする必要がある場合は、SFTP タイプのデプロイサーバー構成を作成する必要があります。 詳細については、 [リモートサーバー構成を作成する](creating-a-remote-server-configuration.html)を参照してください。

> **Tip: OpenSSH ログ**
> SSH 接続のトラブルシューティングを行うには、 [IDE ログ](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#logs-directory)を確認します。 認証エラーの場合は、SSH サーバーログも確認するか、サーバー管理者に問い合わせてください。 保存場所は、サーバーのオペレーティングシステムと構成によって異なります。
>
>
>
> たとえば、Fedora サーバーでは、  `sudo journalctl -u sshd.service`  を実行して SSH サーバーログを表示します。 これらのログは、認証失敗や拒否された接続の特定に役立ちます。

## サポートされている OpenSSH ディレクティブ

OpenSSH 構成および認証エージェント   を使用すると、GoLand は SSH 構成ファイルを読み取ります。 読み取り方法は、  `設定 | 詳細設定 | SSH | 構成ファイルパーサー`  で選択します。

デフォルトの   OpenSSH   オプションでは、お使いのコンピューターに OpenSSH が必要で、構成を読み取るために  `ssh -G`  を実行します。 その後、GoLand はすべての OpenSSH 機能ではなく、SSH 実装でサポートされている設定を適用します。

既存   オプションは GoLand に組み込まれたパーサーを使用し、次のディレクティブをサポートします:

* [サーバー生存確認間隔](https://man.openbsd.org/ssh_config#ServerAliveInterval)

* [暗号方式](https://man.openbsd.org/ssh_config#Ciphers)

* [ClearAllForwardings(英語)](https://man.openbsd.org/ssh_config#ClearAllForwardings)

* [Compression(英語)](https://man.openbsd.org/ssh_config#Compression)

* [ConnectTimeout(英語)](https://man.openbsd.org/ssh_config#ConnectTimeout)

* [ForwardAgent(英語)](https://man.openbsd.org/ssh_config#ForwardAgent)

* [ForwardX11(英語)](https://man.openbsd.org/ssh_config#ForwardX11)

* [ForwardX11Trusted(英語)](https://man.openbsd.org/ssh_config#ForwardX11Trusted)

* [GSSAPIAuthentication(英語)](https://man.openbsd.org/ssh_config#GSSAPIAuthentication)

* [HashKnownHosts(英語)](https://man.openbsd.org/ssh_config#HashKnownHosts)

* [Host(英語)](https://man.openbsd.org/ssh_config#Host)

* [ホストキーアルゴリズム](https://man.openbsd.org/ssh_config#HostKeyAlgorithms)

* [Hostname(英語)](https://man.openbsd.org/ssh_config#Hostname)

* [IdentitiesOnly(英語)](https://man.openbsd.org/ssh_config#IdentitiesOnly)

* [IdentityAgent(英語)](https://man.openbsd.org/ssh_config#IdentityAgent)

* [ID ファイル](https://man.openbsd.org/ssh_config#IdentityFile)

* [鍵交換アルゴリズム](https://man.openbsd.org/ssh_config#KexAlgorithms)

* [LocalForward(英語)](https://man.openbsd.org/ssh_config#LocalForward)

* [MAC](https://man.openbsd.org/ssh_config#MACs)

* [PreferredAuthentications(英語)](https://man.openbsd.org/ssh_config#PreferredAuthentications)

* [ポート](https://man.openbsd.org/ssh_config#Port)

* [ProxyCommand(英語)](https://man.openbsd.org/ssh_config#ProxyCommand)

* [プロキシジャンプ](https://man.openbsd.org/ssh_config#ProxyJump)

* [RemoteForward(英語)](https://man.openbsd.org/ssh_config#RemoteForward)

* [環境変数の送信](https://man.openbsd.org/ssh_config#SendEnv)

* [ServerAliveCountMax(英語)](https://man.openbsd.org/ssh_config#ServerAliveCountMax)

* [環境変数の設定](https://man.openbsd.org/ssh_config#SetEnv)

* [StrictHostKeyChecking(英語)](https://man.openbsd.org/ssh_config#StrictHostKeyChecking)

* [ユーザー](https://man.openbsd.org/ssh_config#User)

* [UserKnownHostsFile(英語)](https://man.openbsd.org/ssh_config#UserKnownHostsFile)

* [XAuthLocation(英語)](https://man.openbsd.org/ssh_config#XAuthLocation)

> **Note:**
> 既存   パーサーでは、  `ForwardAgent`  は  `ssh.agent.forwarding`  レジストリオプションが有効化されている場合にのみ有効になります。 このオプションはデフォルトで有効になっています。

