дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-28 21:42:27 +02:00
A remote window (SSH, WSL, Dev Container) shows a compact CPU and memory indicator beside the connection status; network and disk badges appear only when saturated. Clicking it, or Show Remote Host Resources, opens a dashboard with 60-second sparklines for CPU (cores, load), memory, network (with RPC round-trip latency) and disk (I/O and free space), the OpenIDEA processes on the host grouped by kind, and the top other host processes. End Process asks for confirmation naming the process and PID, and ends only processes in the backend's own tree. Linux /proc and cgroup v2 limits are read for containers. Co-authored-by: dengliu <[email protected]>
159 рядки
10 KiB
Plaintext
159 рядки
10 KiB
Plaintext
---
|
||
title: "SSH"
|
||
description: "Open a project that lives on an SSH host or in a WSL distribution, with the IDE backend running next to the code."
|
||
---
|
||
|
||
Remote development opens a project folder on another machine in a normal OpenIDEA window. The UI stays on your
|
||
desktop; the IDE backend, [`openidea-server`](/en/guide/remote/server), runs on the remote host. Indexing, language
|
||
servers, terminals, run configurations, debuggers, build tools and Git all run there, next to the code.
|
||
|
||
OpenIDEA connects over SSH, or on Windows directly into a WSL distribution. For dev containers, see
|
||
[Containers](/en/guide/remote/containers).
|
||
|
||
## Requirements
|
||
|
||
- An SSH host running Linux (x86_64 or aarch64) or macOS (Apple silicon or Intel). Windows hosts are not supported.
|
||
- A POSIX shell with `uname`, `gzip`, `mkdir`, `chmod`, `mv` and `find` on the host, and the SFTP subsystem enabled
|
||
(used to install the server and by **Browse** in the connect dialog).
|
||
- The first connection downloads the matching `openidea-server` release build to your desktop and uploads it to the
|
||
host. Without internet access on the desktop, see [Offline installation](/en/guide/remote/server#offline-installation).
|
||
|
||
## Add an SSH configuration
|
||
|
||
Remote development, run targets, data source tunnels, deployment servers and **Start SSH Session…** all connect
|
||
through the app-wide SSH configurations.
|
||
|
||
<Steps>
|
||
<Step title="Open the SSH settings">
|
||
Choose **Tools › SSH Configurations…**, or open **Settings › Tools › SSH Configurations**.
|
||
</Step>
|
||
<Step title="Add a configuration">
|
||
Click **+** (Add) and fill in **Name**, **Host**, **Port:** and **User name**.
|
||
</Step>
|
||
<Step title="Pick the authentication type">Choose one of the options under **Authentication type** (see below).</Step>
|
||
<Step title="Test the connection">
|
||
Click **Test Connection**. If the host key is not in `~/.ssh/known_hosts` yet, OpenIDEA shows the key and offers
|
||
**Trust Host and Retry**, which adds it there.
|
||
</Step>
|
||
</Steps>
|
||
|
||
| Authentication type | What it uses |
|
||
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||
| **Password** | A password. Tick **Save password** to keep it in the OS credential store. |
|
||
| **Key pair (OpenSSH or PuTTY)** | A **Private key file** (for example `~/.ssh/id_ed25519`) and its **Passphrase**, which **Save passphrase** keeps in the credential store. |
|
||
| **OpenSSH config and authentication agent** | `HostName`, `User`, `Port`, `IdentityFile` and `ProxyJump` from `~/.ssh/config`, and the keys of the SSH agent. **Host** can be a `Host` alias from `~/.ssh/config`. |
|
||
|
||
Saved passwords and passphrases go to the macOS Keychain, Windows Credential Manager or the Secret Service on Linux,
|
||
never to a settings file. The **+**, **−** and copy buttons above the list add, remove and duplicate configurations.
|
||
|
||
Older versions stored saved credentials in plaintext in `ssh-passwords.json`. On startup, OpenIDEA moves them into
|
||
the OS credential store. If the file still contains passwords, unlock the store and choose **Retry migration**, or
|
||
choose **Remove plaintext copy** and re-enter any credentials that were not migrated. New credentials that cannot
|
||
be saved are kept only for the session. Migration does not change old backups: rotate any exposed password.
|
||
|
||
### `~/.ssh/config` support
|
||
|
||
OpenIDEA has its own SSH client and reads `~/.ssh/config` itself. It understands `Host`, `Match`, `Include`,
|
||
`HostName`, `User`, `Port`, `IdentityFile`, `IdentityAgent`, `ProxyJump`, `ProxyCommand`, `StrictHostKeyChecking` and
|
||
`UserKnownHostsFile`. Jump hosts authenticate with the agent and identity files; the password or passphrase of the
|
||
configuration is only used for the target host.
|
||
|
||
The SSH agent is the one `IdentityAgent` names, otherwise `SSH_AUTH_SOCK` as your login shell sets it, so an agent
|
||
socket exported in `~/.zshrc` (for example a password manager's agent) works even when OpenIDEA is started from the Dock.
|
||
|
||
Host keys are checked against `known_hosts`. An unknown key has to be trusted once; a changed key is refused unless
|
||
host key checking is turned off for that host.
|
||
|
||
## Open a remote project
|
||
|
||
<Steps>
|
||
<Step title="Open the connect dialog">
|
||
Choose **File › Remote Development…**, or click **Remote Development** on the Welcome screen.
|
||
</Step>
|
||
<Step title="Choose the host">
|
||
Pick an entry under **SSH configuration:**. **Configure…** opens the SSH settings if you need to add one.
|
||
</Step>
|
||
<Step title="Choose the folder">
|
||
Type a path under **Project directory:** (`~` and `~/…` are relative to the remote home), or click **Browse** to
|
||
walk the remote folders.
|
||
</Step>
|
||
<Step title="Open">Click **Open**. If a project is already open, choose **This Window** or **New Window**.</Step>
|
||
</Steps>
|
||
|
||
While connecting, the dialog shows each stage: connecting to the host, checking the IDE backend on the host,
|
||
downloading or installing it when needed, starting it, and opening the project. The first connection to a host takes
|
||
longer because of the upload; later ones reuse the installed server.
|
||
|
||
After the project opens you are asked whether to trust it, as for a local folder.
|
||
|
||
<Tip>
|
||
Run **Test Connection** in the SSH settings before the first connection. That is where you trust a new host key and
|
||
enter the password or passphrase.
|
||
</Tip>
|
||
|
||
## Working in a remote window
|
||
|
||
- The window title ends with the host, and the status bar shows **SSH: `<host>`**. Clicking it opens the
|
||
**Remote Development** dialog.
|
||
- Next to **SSH: `<host>`**, the **Remote Host Resources** indicator shows CPU and memory usage of the remote host (and highlights network or disk pressure when saturated). Click it — or run **Show Remote Host Resources** — to open a dashboard with rolling CPU, memory, network (including SSH round-trip latency) and disk graphs, plus running remote processes with **End Process**.
|
||
- Remote projects appear in the recent projects list on the Welcome screen, so you can reopen them from there.
|
||
- Language servers, debuggers and other tools that OpenIDEA installs go to the remote host, under
|
||
`~/.openidea/data`.
|
||
- Your keymap, appearance, editor font and colour scheme stay on the desktop. Project and tool settings live on the
|
||
host.
|
||
- Your code plugins are synced to the server and run next to the project.
|
||
- **Keep Backend Running** when closing a remote window, or **File › Disconnect from Remote Host**, leaves the remote IDE backend and its workloads running. Reopen the project to reattach.
|
||
- **Stop Backend** when closing the window, or **File › Stop Remote Backend**, shuts down the backend and its workloads. See [Stopping a remote backend](/en/guide/remote/server#closing-or-stopping-a-remote-backend) for idle timeout and manual cleanup.
|
||
|
||
### Forward ports
|
||
|
||
A remote window has a **Ports** tool window. Enter a port under **Remote port, e.g. 3000** and click
|
||
**Forward Port**. `localhost:<port>` on the remote host is then reachable on your machine, on the same port when it is
|
||
free or on another free one. Each row can be opened in the browser, copied, or stopped.
|
||
|
||
Forwarded ports are remembered per host and folder, and forwarded again the next time you connect.
|
||
|
||
### Reload the environment
|
||
|
||
The server takes its environment from your login shell on the host when it starts. After changing a shell profile,
|
||
choose **File › Reload Environment** so new terminals, runs and tools get the new values. Processes that are already
|
||
running keep the old environment. When variables changed, the notification offers **Restart Language Servers**.
|
||
|
||
If the remote project has a `.devcontainer/devcontainer.json` or `.devcontainer.json`, its `remoteEnv` is applied too,
|
||
and its `postStartCommand` runs once each time the server starts. A project with an `.envrc` gets its direnv environment
|
||
on the host as it does locally (a Nix flake's devshell with `use flake`), and Reload Environment loads it again; see
|
||
[direnv and Nix flakes](/en/guide/run#direnv-and-nix-flakes).
|
||
|
||
## Start an SSH terminal
|
||
|
||
**Tools › Start SSH Session…** (or **SSH Session…** in the Terminal tool window's new-tab menu) picks an SSH
|
||
configuration and opens a shell on that host in a terminal tab. The IDE's built-in SSH client connects with the
|
||
configuration's saved password, key or agent, and asks for a password or passphrase that isn't saved, or to trust an
|
||
unknown host key. No OpenSSH client is needed. It does not open a remote project.
|
||
|
||
## Connect to WSL (Windows)
|
||
|
||
On Windows, when at least one WSL distribution is installed, the connect dialog shows **Connect through:** with
|
||
**SSH** and **WSL**. Choose **WSL**, pick the **WSL distribution:** and enter the **Project directory:** inside the
|
||
distribution. OpenIDEA installs and starts `openidea-server` inside the distribution with `wsl.exe`; no SSH server is
|
||
needed. The status bar then shows **WSL: `<distribution>`**.
|
||
|
||
Opening a folder under `\\wsl.localhost\<distribution>\` also opens it through the distribution.
|
||
**Browse** is not available for WSL.
|
||
|
||
The **Ports** tool window is available in a WSL window too. Because the distribution shares this machine's
|
||
`localhost`, a forwarded port is reachable here on the same port; the window lists, opens and remembers ports as it
|
||
does for SSH.
|
||
|
||
## Other uses of SSH configurations
|
||
|
||
- **Run targets** (**Settings › Build, Execution, Deployment › Run Targets**) run a configuration on an SSH host. See
|
||
[Run configurations](/en/guide/run).
|
||
- **Data sources** can connect through an SSH tunnel. See [Database](/en/guide/database).
|
||
- **Tools › Deployment** uploads, downloads and syncs project files with a server over SFTP, FTP or FTPS.
|
||
|
||
## Limits
|
||
|
||
- One project per remote window: a remote project can't be attached to another window's projects.
|
||
- The SSH host must run Linux or macOS on x86_64 or aarch64.
|