Agent Terminal
← Blog

Run PowerShell, Command Prompt and Git Bash on your Windows PC from your phone

There are three ways to do it. Only one keeps your shell running when your phone disconnects.

  • 1

    OpenSSH Server

    Best for quick commands on your home Wi-Fi.

    Session ends when the phone disconnects

    Free

  • 2

    OpenSSH + mesh VPN

    Best for the same, from anywhere.

    Session still ends when the phone disconnects

    Free for personal use

  • 3

    A host app

    Best for builds, scripts and agents you walk away from.

    Session keeps running on the PC

    Runs on your own Wi-Fi

1. OpenSSH Server

OpenSSH Server is the SSH server built into Windows 10 (build 1809) and later. Turn it on and any SSH app on your phone can open a shell on the PC over your home Wi-Fi: Command Prompt by default, or PowerShell or Git Bash. The catch: the shell belongs to the connection, so when your phone locks or switches network, the shell ends. tmux, the usual fix, has no native Windows version. Its install guide covers Linux and macOS; on Windows it runs inside WSL, or through MSYS2 or Cygwin.

Show the setup steps
  1. Settings → search Optional features → add OpenSSH Server.
  2. In an admin PowerShell: Start-Service sshd and Set-Service -Name sshd -StartupType 'Automatic'.
  3. Land in PowerShell 7 instead of Command Prompt: New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\PowerShell\7\pwsh.exe" -PropertyType String -Force For Git Bash, use C:\Program Files\Git\bin\bash.exe as the value.
  4. Connect from your phone’s SSH app to the PC’s local IP on port 22. Use a key, not a password.

Source: Microsoft’s OpenSSH setup guide and server configuration page.

2. Add a mesh VPN

A mesh VPN such as Tailscale puts your PC and phone on one private network, so Option 1 works from anywhere without opening a port to the internet. Tailscale’s Personal plan is free for non-commercial use. The catch: it changes where you can connect from, not what happens when you disconnect.

3. A host app

A host app runs the shells on the PC and lets your phone attach and detach. Agent Terminal works this way on Windows and macOS: download it, click the phone icon, scan the QR code.

Where the shell session lives With SSH, the shell belongs to the connection and ends when it drops. With a host app, the shell belongs to a host process on the PC, and the phone only attaches to it. Options 1 and 2: the shell belongs to the connection Phone connection drops The shell ends Option 3: the shell belongs to the PC Phone drops Host app Still running
Why the session survives in Option 3: the phone attaches to a shell the PC owns.

Your phone sees every PowerShell, Command Prompt, Git Bash and WSL tab on the PC, and gets a notification when a long command finishes. It is still SSH underneath, with keys only (how to check). Runs on your own Wi-Fi. Away from home, the free plan relies on n0’s public relays, best effort and not guaranteed; Pro gives you remote access (plans).

Compared

OpenSSH + mesh VPN Host app
Away from homeNoYesBest effort through n0’s public relays; dedicated relays with Pro (plans)
Survives a disconnectNoNoYes
Notifies when doneNoNoYes
Pieces to maintain242

Questions

Can I run tmux on Windows?

Not natively. You can run it inside WSL, or through the MSYS2 and Cygwin packages. WSL’s tmux keeps a Linux shell alive rather than your PowerShell, Command Prompt or Git Bash session.

Is it safe to turn on OpenSSH Server?

Windows opens port 22 for it. Behind a home router that is not forwarding the port, only your own network can reach it. Use keys, and never forward port 22 to the internet.

Do I need OpenSSH or a VPN for Agent Terminal?

No. The desktop app is the SSH server, and pairing is one QR scan.

Checked against Microsoft, Tailscale and tmux documentation on 20 October 2026. Written by Edward, from the team that builds Agent Terminal.