Skip to main content
The Mirage server can listen for SSH next to HTTP. The SSH username names the workspace, every line runs in Mirage’s shell, and every file operation goes through the workspace’s mounts.

Set up

1

Install the SSH library

2

Pick a port

SSH stays off until a port is set.
3

Authorize your key

Only public keys log in, and the file is read on every login.
4

Restart the server

An environment variable wins over ~/.mirage/config.toml, which wins over the default.The server makes its host key on first start and keeps it, so your known_hosts entry stays valid.

Connect

Each run gets a fresh session, so a cd or export never leaks between them. Ctrl-C cancels the running line, and ssh host cmd exits with the line’s status. To mount a folder on the machine running Mirage instead, use FUSE.

Over HTTPS

A hosted server carries SSH over its HTTPS port, so it needs no SSH port or key. mirage ssh-proxy relays it with the CLI’s token:
~/.ssh/config
Then ssh demo@mirage, sftp demo@mirage, scp notes.txt demo@mirage:/data/ and sshfs -o direct_io demo@mirage:/ ~/mnt/demo all work. The CLI sends its token, your mirage login on a hosted server, and the login runs under the workspace’s default profile.

Auth (optional)

In local and token mode, an authorized key opens every workspace under the workspace’s default profile. Options in front of a key in authorized_keys narrow it:
~/.mirage/ssh/authorized_keys
On a jwt server, each login reaches only its account’s workspaces:
  • The account holds for shell, exec, sftp and scp alike.
  • In local and token mode, a key without mirage-account opens every workspace.
  • An option that is empty or given twice opens nothing.
  • Each ssh, sftp or scp run gets a fresh session, closed when it ends.
  • The session’s profile and the mount modes apply as in any shell: a read-only mount refuses sftp put.
  • Output streams as the line prints it.
  • Ctrl-C cancels the running line and sets $? to 130. A dropped connection cancels it too.
  • The server sends a keepalive every 15 seconds and closes a connection that misses three, so a half-open one cancels its line as well.
  • Nothing is forwarded: no ports, no agent, no X11.