Freestyle VMs accept SSH through beta-ssh.freestyle.sh. Use your CLI login
or a Freestyle identity token with access to the VM.
Use Your CLI Login
freestyle login
freestyle vm ssh development --real-ssh
freestyle vm ssh development --real-ssh --team "My Team" --linux-user developer
Native SSH uses your refreshed CLI access token and selected team’s VM access; it does not create an identity. Install an SSH client on your computer if one is not already available. No additional VM software is required.
Without --real-ssh, vm ssh opens a shell through the PTY API. API-key users
of --real-ssh continue to use a temporary VM-scoped identity, which the CLI
cleans up when SSH exits.
Local Port Forwarding
freestyle vm port-forward development 8080:80 5432
This exposes the VM’s TCP ports 80 and 5432 at localhost:8080 and
localhost:5432 on your computer. It uses the same SSH login and runs until
Ctrl+C or a connection failure. Use --address to choose local listen
addresses. See CLI port forwarding
for supported mappings and options.
SSH Format
ssh <vm-id-or-slug>@beta-ssh.freestyle.sh
ssh <vm-id-or-slug>:<access-token>@beta-ssh.freestyle.sh
ssh <vm-id-or-slug>+<linux-user>:<access-token>@beta-ssh.freestyle.sh
If you omit the token from the SSH URL, SSH prompts for it as the password. VM ids work globally. A slug is resolved within the account that owns the access token, so the same slug can safely exist in different accounts.
Omitting +<linux-user> connects you as the VM’s default user: the account
holding uid 1000, or root in an image that has no such account. Ubuntu base
snapshots have ubuntu at uid 1000; freestyle/busybox has no uid-1000 user,
so it connects as root. Pass +root to get a root session on any image.
Create A Token
import { Freestyle } from "freestyle";
const freestyle = new Freestyle();
const slug = "development";
const { vm, vmId } = await freestyle.vms.create({
// Required: a VM reaches nothing it has not been allowed to.
firewall: { rules: [{ action: "allow", source: {}, destination: { public: true } }] }, slug });
const { identity } = await freestyle.identities.create();
await identity.permissions.vm.grant({
vmId,
});
const { token } = await identity.tokens.create();
console.log(`ssh ${slug}:${token}@beta-ssh.freestyle.sh`);
SSH As A Linux User
Linux users are normal guest OS users. Create them inside the VM, then grant an identity access to the matching username.
const slug = "developer-workspace";
const { vm, vmId } = await freestyle.vms.create({
// Required: a VM reaches nothing it has not been allowed to.
firewall: { rules: [{ action: "allow", source: {}, destination: { public: true } }] }, slug });
await vm.exec({
command: `
set -e
if ! id -u developer >/dev/null 2>&1; then
useradd --create-home --shell /bin/bash developer
fi
if getent group sudo >/dev/null 2>&1; then
usermod --append --groups sudo developer
fi
mkdir -p /home/developer/workspace
chown -R developer:developer /home/developer
`,
});
const { identity } = await freestyle.identities.create();
await identity.permissions.vm.grant({
vmId,
allowedLinuxUsers: ["developer"],
});
const { token } = await identity.tokens.create();
console.log(`ssh ${slug}+developer:${token}@beta-ssh.freestyle.sh`);
A grant carrying allowedLinuxUsers requires the connection to name a user.
ssh <slug>:<token>@… against such a grant is refused; use +<linux-user>.
You do not need to copy Freestyle access tokens into the VM. Tokens stay outside the VM and are checked by the SSH proxy before it connects to the Linux account.
Multiple Developers
Create separate identities when different users or agents should have different VM permissions.
const { identity: alice } = await freestyle.identities.create();
await alice.permissions.vm.grant({
vmId,
allowedLinuxUsers: ["alice"],
});
const { identity: bob } = await freestyle.identities.create();
await bob.permissions.vm.grant({
vmId,
allowedLinuxUsers: ["bob"],
});
Keep your Freestyle API key server-side. Send only scoped access tokens to clients or developers.
Editor Connections
Editor connections use the same Freestyle SSH proxy and scoped access tokens as command-line SSH. Create an identity, grant it access to the VM, mint a token, then pass that token in the editor connection URL.
freestyle/busybox is too small for editor connections — the editor’s remote server needs a dynamic libc and more memory than it has. Use an Ubuntu base snapshot for IDE work; terminal SSH works everywhere.
For VS Code and Cursor use one of these URL formats:
vscode://vscode-remote/ssh-remote+<vm-id-or-slug>,<access-token>@<vm-id-or-slug>.beta-ssh.freestyle.sh?windowId=_blank
cursor://vscode-remote/ssh-remote+<vm-id-or-slug>,<access-token>@<vm-id-or-slug>.beta-ssh.freestyle.sh?windowId=_blank
For cmux, use its SSH URL format:
cmux://ssh?host=<vm-id-or-slug>.beta-ssh.freestyle.sh&user=<vm-id-or-slug>,<access-token>&name=<name>