> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/cli/reference/commands/sessions.md).

# Session commands

Every option of devo session: connect to RDP, VNC, SSH, and PowerShell Remoting, run commands, send input, take screenshots, record, and go through a Devolutions Gateway.

This page lists every argument and option of `devo session`, the commands that open remote sessions (RDP, VNC, SSH, and PowerShell Remoting) and drive them from the command line. For an overview of all commands, see [Commands](https://docs.devolutions.net/cli/reference/commands.md).

The options every command accepts, such as `--daemon`, `--context`, or `--output json`, are in [Global options](https://docs.devolutions.net/cli/reference/global-options.md).

**Workspace:** All workspace types. Going through a Devolutions Gateway needs a Devolutions Server or Devolutions Cloud entry, and the recording settings of an entry come from Devolutions Server only.

## How sessions work

* **Each session has a name and a session daemon of its own.** `devo session connect` starts a background process for the session, which keeps the connection open after the command ends. The following commands talk to that process. The session daemon stops when you disconnect, or on its own two minutes after the session ends.
* **The name selects the session.** Every `devo session` command accepts `--session <name>` (`-s`), on the group or on the subcommand. Without it, the command acts on the only open session that supports it, and asks you to pick one when there are several. A new session is named after its `--entry`, else after its type (`rdp`, `vnc`, `ssh`, or `pwsh`). A name has up to 32 letters, digits, `-`, `_`, or `.`, starts with a letter or a digit, and is stored in lowercase.
* **Some commands work with some types only.** A command that the session's type doesn't support says which types have it.
* **Sessions are kept per user.** The list of sessions is in the `devo/sessions` folder of your local state folder: `%LOCALAPPDATA%` on Windows, `$XDG_STATE_HOME` or `~/.local/state` on macOS and Linux. Ended sessions are kept 30 days, 50 at most.
* **Passwords never go on a command line.** They come from an entry, an environment variable, or a file, and the session daemon receives them over a private channel, never through its environment.

{% hint style="info" %}
`list`, `status`, `read`, `wait` on a console, `screenshot`, `exec`, and `disconnect` go through the Devolutions CLI background process, so the operation policy of `devo policy` applies to them. See [Commands](https://docs.devolutions.net/cli/reference/commands.md#approvals-and-operation-policy).
{% endhint %}

## devo session connect

Opens a session and starts its session daemon. To have several sessions open, name each one with `--session`. A name that's already connected is refused, unless you add `--replace`.

```bash
devo session connect rdp|vnc|ssh|pwsh [[user@]host[:port]] [options]
```

### Options of every connect command

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>[user@]host[:port]</code></td><td></td><td>The server to connect to. Defaults to <code>RDP_HOSTNAME</code>, <code>VNC_HOSTNAME</code>, <code>SSH_HOSTNAME</code>, or <code>WINRM_HOSTNAME</code>. With <code>--entry</code>, defaults to the entry's host.</td></tr><tr><td><code>--entry &#x3C;entry></code></td><td></td><td>A vault entry of the current workspace to connect with: a name, a path, an ID, or a <code>devo://</code> reference. It gives the host, the user, and the password unless the options do, and names the session after itself. See <a href="#connect-with-an-entry">Connect with an entry</a>.</td></tr><tr><td><code>--vault-name &#x3C;name></code></td><td>Current vault</td><td>The vault the <code>--entry</code> is in. Only with <code>--entry</code>.</td></tr><tr><td><code>-p</code>, <code>--port &#x3C;port></code></td><td>See each type</td><td>The port, from 1 to 65535.</td></tr><tr><td><code>-u</code>, <code>--username &#x3C;user></code></td><td></td><td>The user name. Defaults to the user in the destination, then to <code>RDP_USERNAME</code>, <code>VNC_USERNAME</code>, <code>SSH_USERNAME</code>, or <code>WINRM_USERNAME</code>.</td></tr><tr><td><code>--password-env &#x3C;variable></code></td><td></td><td>The environment variable that holds the password.</td></tr><tr><td><code>--password-file &#x3C;path></code></td><td></td><td>The file that holds the password. Line breaks at the end are ignored.</td></tr><tr><td><code>--timeout &#x3C;duration></code></td><td><code>60s</code> (RDP, PowerShell), <code>30s</code> (VNC, SSH)</td><td>How long to wait for the connection, like <code>30s</code> or <code>2m</code>.</td></tr><tr><td><code>--replace</code></td><td>Off</td><td>Ends a session already open under this name, whatever its type, and its session daemon, then connects.</td></tr><tr><td><code>--record &#x3C;when></code></td><td><code>auto</code></td><td>Not for PowerShell. <code>auto</code> records as the entry's Devolutions Server settings say. <code>on</code> records to the entry's Devolutions Gateway, or to <code>--record-file</code>, and fails when it can't. <code>off</code> doesn't record, and is refused when Devolutions Server requires the recording. See <a href="#recording">Recording</a>.</td></tr><tr><td><code>--record-file &#x3C;path></code></td><td></td><td>Not for PowerShell. Records the session to this local file instead of a Devolutions Gateway: a WebM video for RDP and VNC, an asciicast for SSH. Can't be combined with <code>--record off</code>.</td></tr></tbody></table>

`--password-env` and `--password-file` can't be combined. Without either, the password comes from the entry, then from `RDP_PASSWORD`, `VNC_PASSWORD`, `SSH_PASSWORD`, or `WINRM_PASSWORD`. SSH and PowerShell also read the `RDP_*` variables when their own aren't set. There's no password prompt.

### connect rdp

Opens an RDP session and waits for the outcome. The default port is 3389.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>--domain &#x3C;domain></code></td><td></td><td>The account domain. Wins over the entry's domain.</td></tr><tr><td><code>--rdp-file &#x3C;path></code></td><td></td><td>A <code>.rdp</code> file to read the base configuration from. With it, the destination is optional.</td></tr><tr><td><code>--prop &#x3C;key>:&#x3C;type>:&#x3C;value></code></td><td></td><td>Sets any connection property, in <code>.rdp</code> line grammar (<code>i</code> or <code>s</code> for the type). Repeat it for several. Wins over <code>--rdp-file</code>, loses to the named options.</td></tr><tr><td><code>--width</code>, <code>--height &#x3C;pixels></code></td><td></td><td>The desktop size, from 200 to 8192 pixels.</td></tr><tr><td><code>--accept-certificate &#x3C;sha256></code></td><td></td><td>Accepts a server certificate that fails validation, for this connection only, when its SHA-256 fingerprint matches. Repeat it for several.</td></tr><tr><td><code>--skip-certificate-check</code></td><td>Off</td><td>Accepts any server certificate and name. See <a href="#certificates-and-host-keys">Certificates and host keys</a>.</td></tr><tr><td><code>--no-wait</code></td><td>Off</td><td>Returns once the session daemon accepts the request. Check the outcome with <code>devo session status</code>. Can't be combined with <code>--timeout</code>.</td></tr><tr><td><code>--log-directive &#x3C;filter></code></td><td></td><td>A tracing filter for the session's logs, like <code>ironrdp_connector=trace</code>. Read them with <code>devo session logs</code>.</td></tr></tbody></table>

### connect vnc

Opens a VNC session and waits for the first frame. Works with Apple Remote Desktop and regular VNC servers. The default port is `VNC_PORT`, else 5900. When the first frame doesn't come in time, the command doesn't fail: check the session with `devo session status`.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>--protocol &#x3C;handshake></code></td><td><code>ard</code></td><td><code>ard</code> answers Apple Remote Desktop and regular VNC servers. <code>rfb</code> follows RFC 6143 only.</td></tr><tr><td><code>--encodings &#x3C;list></code></td><td></td><td>The encodings to advertise, in order, like <code>tight,zrle,raw</code>.</td></tr><tr><td><code>--jpeg-quality &#x3C;0-9></code></td><td></td><td>The JPEG quality for Tight encoding.</td></tr><tr><td><code>--view-only</code></td><td>Off</td><td>Observes without controlling (Apple Remote Desktop).</td></tr><tr><td><code>--no-clipboard</code></td><td>Off</td><td>Doesn't exchange clipboard text.</td></tr><tr><td><code>--skip-certificate-check</code></td><td>Off</td><td>Accepts any TLS certificate (VeNCrypt, Apple Remote Desktop). See <a href="#certificates-and-host-keys">Certificates and host keys</a>.</td></tr><tr><td><code>--no-wait</code>, <code>--log-directive</code></td><td></td><td>Same as for <code>connect rdp</code>. The log filter example is <code>ironvnc_connector=trace</code>.</td></tr></tbody></table>

### connect ssh

Opens an SSH session. The default port is 22. The host key must be in `known_hosts`, or accepted.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>-i</code>, <code>--identity-file &#x3C;path></code></td><td></td><td>The private key to sign in with. It's tried before the password.</td></tr><tr><td><code>--passphrase-env &#x3C;variable></code></td><td></td><td>The environment variable that holds the private key's passphrase.</td></tr><tr><td><code>--known-hosts &#x3C;path></code></td><td><code>~/.ssh/known_hosts</code></td><td>The <code>known_hosts</code> file.</td></tr><tr><td><code>--accept-host-key &#x3C;SHA256:...></code></td><td></td><td>Accepts a host key missing from <code>known_hosts</code>, for this connection only, when its fingerprint matches. Repeat it for several.</td></tr><tr><td><code>--trust-host-key &#x3C;SHA256:...></code></td><td></td><td>Accepts a host key missing from <code>known_hosts</code> when its fingerprint matches, and adds it to the file. Repeat it for several.</td></tr></tbody></table>

### connect pwsh

Opens a PowerShell Remoting (WinRM) session. The default port is 5985, or 5986 with `--https`. Plain HTTP is sealed with SSPI; `--https` uses TLS.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>--https</code></td><td>Off</td><td>Connects over HTTPS.</td></tr><tr><td><code>--auth &#x3C;method></code></td><td><code>negotiate</code></td><td><code>negotiate</code> (Kerberos, else NTLM), <code>ntlm</code>, <code>kerberos</code>, or <code>basic</code>. Basic sends the password in the clear, so it's accepted with <code>--https</code> only.</td></tr><tr><td><code>--insecure</code></td><td>Off</td><td>Accepts any HTTPS certificate. See <a href="#certificates-and-host-keys">Certificates and host keys</a>.</td></tr><tr><td><code>--ca-certificate &#x3C;path></code></td><td></td><td>A PEM root certificate to trust for HTTPS, in addition to the system roots. Can't be combined with <code>--insecure</code>.</td></tr><tr><td><code>--configuration &#x3C;name></code></td><td><code>Microsoft.PowerShell</code></td><td>The session configuration (JEA endpoint) to connect to.</td></tr></tbody></table>

### Connect with an entry

`--entry` reads the entry in the current workspace, with `--vault-name` or the current vault, and uses its host, port, user, domain, and password:

* The entry's type must match the command: an RDP entry opens `connect rdp`, a VNC or Apple Remote Desktop entry opens `connect vnc`, an SSH Shell entry opens `connect ssh`, and a PowerShell Remote Console entry opens `connect pwsh`. Other entries are refused.
* A destination you give wins over the entry's host. Given with its own port, it also wins over the entry's port.
* A user you give, with `--username` or `user@`, signs in as someone else: the entry's user, password, and domain aren't used.
* `--password-env` or `--password-file` replaces the entry's password.
* The password goes to the session daemon, never to the output of the command.

`--entry` doesn't check out a privileged account, and doesn't send a comment or a ticket number. When the workspace doesn't return the entry's password, the connection falls back to the `*_PASSWORD` variables, then fails for lack of a password or at sign-in.

### Recording

* RDP and VNC record a WebM video, which needs the Cadeau XMF library next to `devo`, or at `DEVO_LIB_XMF_PATH`. SSH records an asciicast. PowerShell sessions can't be recorded.
* With `--record auto`, a session opened with a Devolutions Server entry follows the entry's recording mode: required, optional, or none. Other sessions aren't recorded.
* `--record on` records to the entry's Devolutions Gateway, which needs a Devolutions Server entry, or to `--record-file`.
* `--record-file` works with any workspace. The file is readable by your account only. When Devolutions Server requires a recording by its Devolutions Gateway, `--record-file` and `--record off` are refused.

### Certificates and host keys

* **RDP:** a certificate that fails validation must be accepted or pinned. At an interactive terminal, `devo` shows its SHA-256 fingerprint and asks whether to connect once, always trust it, or stop. Otherwise, the connection fails with `rdpCertificateUntrusted` and the fingerprint. After you check the fingerprint out of band, pass it to `--accept-certificate`, or pin it with `devo session cert trust`.
* **SSH:** a host key missing from `known_hosts` is handled the same way, with `--accept-host-key` and `--trust-host-key`.
* **PowerShell:** with `--https`, the certificate is checked against the system roots and `--ca-certificate`.

{% hint style="warning" %}
`--skip-certificate-check` (RDP, VNC) and `--insecure` (PowerShell) accept any certificate, so anyone on the network path can intercept the session and its credentials. Use them only with a test endpoint you're explicitly allowed to use. `--skip-certificate-check` applies when the session daemon starts: to change it, disconnect the session first.
{% endhint %}

### Through a Devolutions Gateway

A session goes through a Devolutions Gateway on its own when all of these are true:

* You connect with `--entry`, from a Devolutions Server or Devolutions Cloud workspace.
* The entry's settings use a Devolutions Gateway.
* You don't give a destination. A destination goes straight to that server, not through the gateway.

There's no option to select a gateway. Through a gateway, the session goes to the entry's own port, so a different `--port` is refused. For PowerShell, the gateway opens the HTTPS connection itself: `--insecure` and `--ca-certificate` don't apply, and `--https` must match the entry's endpoint.

## devo session list

Lists the sessions, their type, state, and server. The text output lists the open sessions and counts the ended ones; JSON and YAML list every session.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>--all</code></td><td>Off</td><td>Lists the ended sessions too, after the open ones.</td></tr><tr><td><code>--ended</code></td><td>Off</td><td>Lists only the ended sessions. Can't be combined with <code>--all</code>.</td></tr></tbody></table>

## devo session status

Shows a session's state, server, and session daemon, without opening or removing it. Takes `--session` only.

## devo session wait

Waits for a session state, or watches an SSH or PowerShell console without controlling it.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>--for &#x3C;condition></code></td><td><code>connected</code></td><td><code>connected</code> or <code>ended</code> for the session; <code>text:&#x3C;regex></code>, <code>idle</code>, <code>change</code>, or <code>exit</code> for a console, which need <code>--session</code>. <code>exit</code> means the console's program or pipeline ended.</td></tr><tr><td><code>--timeout &#x3C;duration></code></td><td><code>30s</code>, console <code>15s</code></td><td>Gives up after this duration. A console wait lasts 60 seconds at most.</td></tr><tr><td><code>--idle-for &#x3C;duration></code></td><td><code>500ms</code></td><td>How long the output must stay quiet, with <code>--for idle</code>.</td></tr><tr><td><code>--console-id &#x3C;id></code>, <code>--after &#x3C;n></code></td><td></td><td>The console instance and output position of a previous read, to wait for what comes after. Use both together.</td></tr></tbody></table>

## devo session read

Reads an SSH or PowerShell console without opening it or taking control of it. `--session` is required. `--console-id` and `--after`, used together, read only what came after a previous read.

## devo session attach

Uses a session live in this terminal until <kbd>Ctrl</kbd>+<kbd>]</kbd>, which leaves it open. For RDP and VNC, the desktop is drawn with the terminal's graphics and takes the keyboard and mouse. For SSH, it's an interactive shell. For PowerShell, a prompt runs each line. Needs an interactive terminal.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>--protocol &#x3C;graphics></code></td><td><code>auto</code></td><td>RDP and VNC: how to draw the desktop. <code>auto</code> (what the terminal supports), <code>sixel</code>, <code>kitty</code>, <code>iterm2</code>, or <code>blocks</code> (half-block characters, any true-color terminal). Defaults to <code>DEVO_GRAPHICS_PROTOCOL</code>.</td></tr><tr><td><code>--fit</code></td><td>Off</td><td>RDP and VNC: resizes the desktop to the terminal, now and whenever the terminal is resized. <kbd>Ctrl</kbd>+<kbd>\</kbd> fits it once.</td></tr><tr><td><code>--view-only</code></td><td>Off</td><td>RDP and VNC: watches the desktop without sending any input, alongside the person using it.</td></tr><tr><td><code>--interval &#x3C;duration></code></td><td><code>250ms</code></td><td>RDP and VNC: how often to look for a new frame while the desktop changes.</td></tr><tr><td><code>--persistent</code></td><td>Off</td><td>SSH and PowerShell: uses the persistent workspace console, with <kbd>F12</kbd> local controls.</td></tr></tbody></table>

## devo session exec

Runs a command on an SSH or PowerShell session and streams its output. The SSH exit status becomes `devo`'s; a PowerShell script with errors exits with `1`. Cancelling can't undo what already ran on the server. On an RDP session, use `devo session now`.

```bash
devo session exec [options] [--] <command>...
```

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>&#x3C;command></code></td><td></td><td>The command line or script. Quote it, or put it after <code>--</code> when it has options of its own.</td></tr><tr><td><code>--file &#x3C;path></code></td><td></td><td>PowerShell: runs this UTF-8 <code>.ps1</code> file instead. <code>-</code> reads the script from standard input.</td></tr><tr><td><code>--stdin &#x3C;path></code></td><td>Empty</td><td>SSH: sends this file as standard input. <code>-</code> reads this command's standard input.</td></tr><tr><td><code>--pty</code></td><td>Off</td><td>SSH: allocates a pseudo-terminal, for commands that need one.</td></tr><tr><td><code>--timeout &#x3C;seconds></code></td><td>None</td><td>Gives up after this many seconds, counted after the operation policy admits the command.</td></tr></tbody></table>

The input is limited to 4 MiB.

## devo session disconnect

Closes an SSH or PowerShell session and stops its session daemon.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>--all</code></td><td>Off</td><td>Requests the shutdown of every session. Can't be combined with <code>--session</code>.</td></tr><tr><td><code>--yes</code></td><td>Off</td><td>Confirms a shutdown submitted with the global <code>--async</code> option, which also needs one explicit <code>--session</code>.</td></tr></tbody></table>

## devo session forget

Forgets ended sessions, so `devo session list --all` and `devo session reconnect` no longer have them. A session that's still open is refused: disconnect it instead.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>&#x3C;name>...</code></td><td></td><td>The ended sessions to forget.</td></tr><tr><td><code>--ended</code></td><td>Off</td><td>Forgets every ended session instead of named ones.</td></tr><tr><td><code>--older-than &#x3C;duration></code></td><td></td><td>With <code>--ended</code>, only the sessions that ended at least this long ago, like <code>7d</code> or <code>12h</code>.</td></tr></tbody></table>

## devo session reconnect

Closes a session and opens it again under the same name, with the `connect` that opened it. The password is read again from where that `connect` read it. A session opened with `devo session serve`, or with a secret in `--prop`, can't be reconnected.

## devo session logs

Prints the log lines the session daemon keeps: the protocol's own for RDP and VNC; connections, commands (never their text), and transfers for SSH and PowerShell.

<table><thead><tr><th width="300">OPTION</th><th width="130">DEFAULT</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>--contains &#x3C;text></code></td><td></td><td>Only the lines that contain this text.</td></tr><tr><td><code>--last &#x3C;n></code></td><td></td><td>Only the last <em>n</em> lines kept.</td></tr></tbody></table>

## Files on an SSH session

These commands use SFTP on an SSH session.

<table><thead><tr><th width="300">COMMAND</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>upload &#x3C;local> &#x3C;remote></code></td><td>Copies a local file to the server. <code>--force</code> replaces the destination when it exists.</td></tr><tr><td><code>download &#x3C;remote> &#x3C;local></code></td><td>Copies a file from the server. <code>--force</code> replaces the destination when it exists.</td></tr><tr><td><code>ls [&#x3C;path>]</code></td><td>Lists a remote folder. Defaults to the sign-in folder.</td></tr></tbody></table>

## Desktops: screenshots and input

These commands work with RDP and VNC sessions.

<table><thead><tr><th width="300">COMMAND</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>screenshot [&#x3C;path>]</code></td><td>Saves the current frame as a PNG file, <code>screenshot.png</code> by default. <code>--terminal</code> draws it in this terminal instead, with <code>--protocol</code> (like <code>attach</code>) and <code>--columns</code>. VNC only: <code>--wait</code> waits for the first frame, from <code>0s</code> to <code>60s</code>, <code>20s</code> by default.</td></tr><tr><td><code>mouse move &#x3C;x> &#x3C;y></code></td><td>Moves the pointer to an absolute position.</td></tr><tr><td><code>mouse click [&#x3C;x> &#x3C;y>]</code></td><td>Clicks a button, at <em>x</em>, <em>y</em> when given, else at the current position. <code>--button</code>: <code>left</code> (the default), <code>right</code>, <code>middle</code>, <code>x1</code>, or <code>x2</code>. <code>--double</code> double-clicks.</td></tr><tr><td><code>mouse down</code>, <code>mouse up</code></td><td>Presses or releases a button. Takes <code>--button</code>.</td></tr><tr><td><code>mouse wheel &#x3C;delta></code></td><td>Turns the wheel: positive away from the user, 120 for one notch. <code>--horizontal</code> turns it sideways.</td></tr><tr><td><code>key press &#x3C;keys>...</code></td><td>Presses and releases keys or shortcuts in order, like <code>enter</code>, <code>f5</code>, <code>ctrl+c</code>, <code>win+r</code>, or <code>ctrl+alt+delete</code>. RDP keys are US-layout positions; VNC keys are symbols.</td></tr><tr><td><code>key down &#x3C;keys></code>, <code>key up &#x3C;keys></code></td><td>Presses keys and holds them, or releases them. A key is a name (<code>ctrl</code>, <code>enter</code>, <code>a</code>), several joined with <code>+</code>, or a <code>0x</code> code: an RDP set-1 scancode, or a VNC X keysym.</td></tr><tr><td><code>type [&#x3C;text>]</code></td><td>Types text as Unicode input, which works with any remote keyboard layout. <code>--enter</code> presses <kbd>Enter</kbd> after the text.</td></tr><tr><td><code>resize &#x3C;width> &#x3C;height></code></td><td>Resizes the remote desktop, when the server allows it. RDP reconnects when the server lacks dynamic resolution.</td></tr><tr><td><code>clipboard get</code></td><td>Prints the last text the remote clipboard offered.</td></tr><tr><td><code>clipboard set &#x3C;text></code></td><td>Puts text on the remote clipboard.</td></tr></tbody></table>

## RDP only

<table><thead><tr><th width="300">COMMAND</th><th>WHAT IT DOES</th></tr></thead><tbody><tr><td><code>props</code></td><td>Lists the session's live connection properties, never the secrets. <code>--filter</code> keeps the keys that contain a text, <code>--prefix</code> the keys that start with it, without regard to case. Use one or the other.</td></tr><tr><td><code>now capabilities</code></td><td>Shows what the host's Devolutions NOW agent supports. Every <code>now</code> command needs that agent on the host.</td></tr><tr><td><code>now powershell &#x3C;command></code>, <code>now pwsh &#x3C;command></code></td><td>Runs a Windows PowerShell or PowerShell 7 command and streams its output. <code>--profile</code> loads the PowerShell profile, <code>--interactive</code> runs without <code>-NonInteractive</code>.</td></tr><tr><td><code>now process &#x3C;program></code></td><td>Runs a program and streams its output. Its exit code becomes <code>devo</code>'s. <code>--parameters</code> gives its command-line parameters.</td></tr><tr><td><code>now batch &#x3C;command></code></td><td>Runs a <code>cmd.exe</code> batch command and streams its output.</td></tr><tr><td><code>now run &#x3C;target></code></td><td>Opens a remote file or URI, without tracking it. <code>--directory</code> sets the working folder.</td></tr><tr><td><code>now list</code>, <code>now status &#x3C;id></code>, <code>now cancel &#x3C;id></code></td><td>Lists the operations the session daemon keeps, shows one, or cancels a running one.</td></tr><tr><td><code>now attach &#x3C;id></code></td><td>Replays an operation's output and follows it until it ends. <code>--after-sequence</code> replays only what came after a position.</td></tr><tr><td><code>now stdin &#x3C;id> --input &#x3C;path></code></td><td>Sends standard input to a running operation. <code>-</code> reads this command's standard input. <code>--last</code> closes the input after this part.</td></tr><tr><td><code>now diagnostics</code></td><td>Shows the state of the local NOW channel.</td></tr><tr><td><code>cert trust &#x3C;host[:port]> &#x3C;sha256></code></td><td>Pins a server certificate by its SHA-256 fingerprint, for every session. The port defaults to 3389. Check the fingerprint out of band first.</td></tr><tr><td><code>cert list</code>, <code>cert remove &#x3C;host[:port]></code></td><td>Lists the pinned certificates, or removes one.</td></tr></tbody></table>

`now powershell`, `now pwsh`, `now process`, and `now batch` also take `--directory` (the working folder), `--stdin <path>`, `--timeout <seconds>`, `--detached` (submit without waiting: no output, input, or exit code), and `--operation-id-file <path>` (write the operation ID, for a later `attach`, `stdin`, or `cancel`).

## devo session serve

Runs a session daemon in this terminal, logging to standard error, until <kbd>Ctrl</kbd>+<kbd>C</kbd>. Connect it from another terminal with `devo session connect <type> --session <name>`. For troubleshooting.

```bash
devo session serve rdp|vnc|ssh|pwsh [--session <name>] [--skip-certificate-check]
```

`--skip-certificate-check` is for RDP and VNC only.

## Environment variables

<table><thead><tr><th width="300">VARIABLE</th><th>WHAT IT SETS</th></tr></thead><tbody><tr><td><code>RDP_HOSTNAME</code>, <code>RDP_USERNAME</code>, <code>RDP_PASSWORD</code></td><td>The server, user, and password of <code>connect rdp</code>. SSH and PowerShell fall back to them.</td></tr><tr><td><code>SSH_HOSTNAME</code>, <code>SSH_USERNAME</code>, <code>SSH_PASSWORD</code></td><td>The server, user, and password of <code>connect ssh</code>.</td></tr><tr><td><code>WINRM_HOSTNAME</code>, <code>WINRM_USERNAME</code>, <code>WINRM_PASSWORD</code></td><td>The server, user, and password of <code>connect pwsh</code>.</td></tr></tbody></table>

`devo` doesn't pass the `*_USERNAME` and `*_PASSWORD` variables to a session daemon's environment.

## Errors

The error codes of these commands are listed in [Error codes](https://docs.devolutions.net/cli/reference/error-codes.md#sessions).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/cli/reference/commands/sessions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
