Most administrator verbs change something inside SD. These four change the
machine SD is running on: whether an ssh server exists, who may reach it, whether
SD opens its API socket, and whether sd runs from any directory.
ssh.server |
adds or removes the Windows OpenSSH server |
remote.ssh |
decides who may reach it |
remote.api |
decides whether SD opens its API socket, and who may reach it |
append.sd.path |
puts SD's program directory on the Windows system PATH, or takes it off |
None of these gives SDSYS remote access, and no setting of these four verbs does. Opening ssh or the API to other computers opens it for ordinary accounts only — and of those, only the accounts SDSYS has given the route (
ssh,apiorboth, increate.accountandmodify.account, orfiles-on, the narrower files-only API route), since a new account has none of them. SDSYS has neither route under any setting these four verbs control — it is never joined tosdsshorsdapi, so opening a route here does not touch SDSYS at all. The administrator's own remote doors are separate and shut as delivered:remote.sdsys onopens remote administration for the account SDRADMIN over ssh (Remote Administration over ssh), andremote.sdsys api onopens SDSYS's API login for chosen addresses (Remote Administration through the API). Administration needs a session Windows can show a consent prompt on, which means the console, or a remote desktop or remote-control product installed as a service. The operating system access page covers this in full.
An account that has the ssh route signs in with its password, not a key, as delivered.
Key sign-in for a Windows user SD made is a separate, per-account loosening
(modify.account name ssh-key-on), and remote.ssh on does not open it. See Signing in
over ssh with a key in Accounts and Security: The Home Screen, ssh Keys and Passwords.
This document is separate so that it can be withheld. It links to nothing outside the administrator set. Where a page in another set is worth naming, it is named in words.
SD folds case, so a command may be typed in either case. Commands are shown here in lower case.
All four need SDSYS, including to report#
Each of them begins by testing the administrator flag, and stops if it is not set:
:ssh.server
Command requires administrator privileges
That was run from an ordinary account. The test runs before the keyword is read, so the reporting forms are refused too — there is nothing softer about asking one of these verbs to just report the current setting.
The reason is the work they do rather than the information they give. Each one
reaches Windows through SD's elevated helper, and a session that is not SDSYS
has no helper to reach it through. Reading the answer costs the same rights as
changing it: Get-WindowsCapability cannot report whether a Windows capability
is installed without administrator rights either.
There is no route to this that does not already carry the flag. Signing
in to Windows as SDSYS and starting sd elevated is the only way in, and it
sets the flag at session start; a session that reached an ordinary account by
logto never had it, and logto sdsys from there is refused unless the
session started in SDSYS — see
SDSYS is the only administrator
in this set's own Accounts and Security chapter.
Every one of them reports when given no keyword#
ssh.server
remote.ssh
remote.api
append.sd.path
With no keyword each reports the current state and changes nothing. This is the supported way to answer "how is this machine set up?", and for ssh it is the only reliable way — see below.
ssh.server#
ssh.server {install | remove}
Finding out whether a server is installed#
Windows 11 does not list the OpenSSH server in Settings → Apps, and it has never appeared in Control Panel → Programs and Features. Somebody looking there concludes it was never installed, which is the wrong conclusion and an easy one to reach.
It is a Feature on Demand, not a program. In Windows 11 it lives under Settings → System → Optional features; in Windows 10 it was under Settings → Apps, which is where anyone who learned this on Windows 10 will look first.
The PowerShell route is not a fallback either, because Get-WindowsCapability
-Online needs administrator rights even to read.
So ssh.server with no keyword is the answer: it reports, changes nothing, and
works because it goes through SD's elevated helper.
The OpenSSH server is installed and running.
Who may reach it is a separate setting - use "remote.ssh" to see or change it.
install#
Where the server comes from depends on how SD was installed. When the installer
was given Microsoft's OpenSSH installer (an ssh-server folder beside it), it
keeps a copy in the SD folder, and ssh.server install uses that copy: a few
seconds, no network, and no question first.
Without that copy the server is Windows' own capability, and it comes from Windows Update. It can take several minutes, and up to about an hour on a slow machine or connection, with little on screen while it runs. The verb asks before starting for that reason.
After the capability Windows needs a restart before the service exists, so no SD account can sign in until the machine has been restarted. The server from the OpenSSH installer normally starts at once.
remove#
remove asks first, and the question is not a formality. Accounts SD creates
sign in over ssh or over the API and are denied the console and Remote Desktop.
For an account that has only ssh — including at this keyboard, where it arrives
by ssh localhost — removing the server takes away its only way in.
A server that came from Windows' capability is staged behind a reboot. Windows
reports success while sshd.exe is still on disk and the service is still
running, so ssh continuing to work afterwards is expected and is not a fault.
A server that came from the OpenSSH installer is removed at once: the service
and sshd.exe are gone when the verb returns, and no restart is needed. The
verb says which of the two happened.
One consequence is worth knowing before you remove it.
C:\ProgramData\ssh is left in place, because neither removal deletes it. It
holds the host keys and sshd_config. That matters for one thing: running the
SD installer on this machine again. Setup compares sshd_config against the
copy the server ships, sshd_config_default — and that copy went with the
server, so Setup cannot tell whether the configuration has been edited and stops
rather than guess.
ssh.server install is not affected: it puts the server back and
sshd_config_default comes back with it. Remove the directory as well only if
you do not intend to run an ssh server on this machine again.
remote.ssh#
remote.ssh {on | off}
on |
other computers on the network may connect over ssh |
off |
only this computer may connect |
It takes effect at once, needs no restart, and disconnects nobody.
off does not stop the server. It scopes the Windows firewall rule
OpenSSH-Server-In-TCP rather than disabling it, and that distinction is
load-bearing: disabling the rule would also break ssh localhost, which is how
an SD account signs in at this keyboard. To remove the server itself, use
ssh.server remove.
If there is no ssh server, the verb says so and points at ssh.server install
rather than reporting a state it cannot have.
remote.api#
remote.api {on | local | off {restart | no.restart}}
on |
SD listens on port 4247 on every address and other computers may connect |
local |
SD listens on 127.0.0.1:4247 only, and only this computer may connect |
off |
SD opens no API socket at all |
There are two axes here and the verb sets both. APIPORT in sd.conf
decides whether SD opens a socket at all, and APILOCAL=1 beside it makes that
socket listen on the loopback address only; the firewall rule decides who may
reach it. local sets both narrow: a loopback listener and the rule shut, so
Windows never asks whether to let SD's listener through, as it did when
local still listened on every address.
SD opens its socket when it starts, so any move between on, local and
off offers to restart SD. The firewall part takes effect at once.
The restart ends every SD session, including the one that asked for it. The verb says so in the question rather than afterwards. Declining leaves the setting written and it takes effect when SD is next started.
restart or no.restart after the word answers that question in advance,
so nothing is asked: restart restarts SD if the listener moved, no.restart
leaves the change for SD's next start. The tool.remote page runs it with
no.restart and, when the listener moved, asks in a box of its own (below). A move between on and local restarts
nothing either way.
If the listener is set but the firewall rule cannot be written, the verb says which half succeeded and prints the two commands that set the rule by hand. This is a real state and not a theoretical one: the setting and the rule are different objects and either can fail on its own.
A Windows firewall Block rule wins over SD's own rule, and SD reports one but
never removes it. Windows makes such a rule when somebody presses Cancel at
its "allow this program through the firewall?" alert for sdwind.exe, and an
administrator or another tool may make one on purpose. While an enabled inbound
Block rule covers sdwind.exe (the program SD's API listens in) or TCP port
4247, other computers cannot connect, whatever remote.api on set. So
remote.api on, remote.api with no word, and the tool.remote page each name
the rule:
WARNING - the Windows firewall rule "<display name>" (<name>) BLOCKS the API,
so other computers cannot connect until it is disabled or removed
SD leaves the rule alone because it may be somebody's deliberate choice. To let
other computers in, an administrator disables or removes it in Windows Defender
Firewall with Advanced Security (wf.msc, Inbound Rules), or from an elevated
PowerShell with the name the warning gives:
Disable-NetFirewallRule -Name "<name>"
Doing so opens the API port to every computer the network lets reach this one, subject to SD's own rule and SD's sign-in.
append.sd.path#
append.sd.path {on | off}
on |
put SD's program directory on the Windows system PATH |
off |
take it off |
This is what lets sd run from any directory rather than only its own.
It is the system PATH, not the user's. The value lives under
HKLM\...\Session Manager\Environment, so the change applies to every account
on the machine. A terminal that is already open keeps the PATH it started with;
open a new one to see the change.
Turning it off does not make SD unreachable. sd still runs from its own
directory or by full path, and append.sd.path on puts it back.
Why this verb exists#
It is not symmetry with the other three. The installer's PATH tickbox could set this once and never again: nothing removed the entry except the uninstaller, so clearing the box on a later run did nothing at all. An upgrade shows no tasks page whatsoever, on the principle that an administrator who wants to make further choices has command-line tools for them — and that left the PATH setting with no way to be changed after the first install. This is that tool.
Why it is not called set.path#
Inside SD, path already means the account's path: pathname is a VOC
keyword, where prints the account pathname, and @path holds it. set.path
would read as setting that. os.path collides with the notion of a host
filesystem path. append.sd.path cannot be read as either.
Everything that reaches SD from outside, on one screen: tool.remote#
tool.remote
A full-screen page in SDSYS's VOC only (a window of 140 columns by 43 lines or more) of six views,
chosen with the keys 1 to 6:
| View | What it shows and does |
|---|---|
1 doors |
what remote.api and remote.ssh say with no keyword: the machine's own answer, read back from sd.conf and the firewall rules, not what the page meant. A changes the API (on, local or off) on a form and runs remote.api ... no.restart, so nothing is asked on the terminal. When the change needs a restart (to or from off), a box says why, that a restart signs out everyone using SD and ends this session too, and offers Restart or Not now (the default): Restart closes the page, clears the screen, says SD is restarting and restarts it (the window closes), Not now leaves the change for SD's next start; S changes ssh (on or off) at once. Each starts on off. Turning either on lets other computers reach this one, so its box wants the word open typed (in either case) |
2 routes |
every user account with the doors it has (ssh, api, files, files-write, files-admin) and the NET gate, and in words how it can be reached: a door is membership of its Windows group. It only shows: the switches are tool.gates's |
3 servers |
the SDNet servers of the netservers file: name, address, remote account and mode, the pin shortened, the local accounts that may use it. X deletes the one under the cursor (delete.server, which does not ask itself, so the box is the question). N asks every field, checks them the way set.server does and gives the terminal to the verb, whose connect step shows the key the server presents and asks whether to trust it |
4 connected |
every session now by the door it came through: the user number, the kind (user, api, sdnet, phantom), the login user, the account and where it came from |
5 TLS |
this machine's TLS identity as settings.report gives it: the certificate fields and the public-key hash another SD server pins. Never the private key |
6 remote administration |
what remote.sdsys says with no keyword: the walls that remote administration for SDRADMIN stands behind, one line each (shut as delivered). O opens it (its box wants the word open typed) and gives the terminal to the verb, because the first opening makes the account and asks its Windows password twice; F shuts it. See Remote Administration over ssh. Below the report are two fields, Local ssh users and Local API users: the Windows users who may reach SDSYS from this computer, both empty as delivered. Up and Down choose a field; U adds a name to it (its box shows the warning and wants the name typed again), X removes a name chosen from the list, C clears the list. See Reaching SDSYS from Your Own Login |
A can end your own session. Any move between on, local and off moves the listener, which SD
opens only when it starts, so A's form asks whether to restart SD now (later is the default), and a
restart ends every SD session, this page's too. Answered later, the setting waits for the next start of SD.
remote.api, remote.ssh, delete.server, remote.sdsys off and local.sdsys with add, remove or clear run through the routine all the toolkit pages use, each only after a
box that shows the command and what it does was answered Run (Cancel is what Enter chooses); while the change runs the status line says
"Making the change (a few seconds)...";
set.server and remote.sdsys on are run by the verb itself on the terminal, after the same box. The verbs
ask for the administrator again and write their own audit lines; the page writes nothing. F5 reads
everything again, F1 explains the page and Ctrl-Q leaves. Opening the page writes the audit line
tool start app=tool.remote.
When a change fails#
All four report a failure rather than falling silent, and every failure message names what did not happen and confirms that nothing was changed. Two status values recur and mean different things:
| status 1 | Windows refused the change, or SD is not running elevated |
| status -1 | the helper could not be run at all |
remote.api adds status 2, which means sd.conf could not be read — missing,
unreadable, or carrying no APIPORT line to recognize.
For a BASIC program that runs one of them: remote.api and remote.ssh
set @SYSTEM.RETURN.CODE to 0 when the change was made and to a negative number
when it was refused or failed, as the account commands do. A change that took
effect also writes an audit record, remote.api on, remote.api local,
remote.api off, remote.ssh on or remote.ssh off.