Most administrator verbs change something inside SD. These two change the machine SD is running on: who may reach it over ssh, and whether SD opens its API socket at all.
remote.ssh |
decides who may reach the machine's ssh server |
remote.api |
decides whether SD opens its API socket, and who may reach it |
Neither of these installs or removes anything. sshd is the
distribution's own service — installed, started and kept current the way
every other Linux service is, outside SD's remit entirely. These two verbs
only move the firewall rule and the API socket that sit in front of it;
they follow the SD Core for Windows verbs of the same name: a behavior
prevented on one port is prevented on both, with the mechanism free to differ
where the operating system does.
Neither gives SDSYS remote access, and no setting of these two 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 no API route from another computer at all, and its ssh door stays shut until the administrator opens it (remote.sdsys on) — a separate act, with its own switch, and then a sign-in with thesdsyspassword alone. See Remote Administration over ssh. Without that, administration needs a real login assdsysat the machine's own keyboard, or a desktop-sharing view of it. See Accounts and Security.
An account that has the ssh route signs in with its password, not a key, as delivered.
Key sign-in for a Linux 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.
Both need SDSYS, including to report#
Each of them begins by testing the administrator flag — a real sdsys
login, not merely elevation — and stops if it is not set:
:remote.ssh
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, because reading the answer means reading the firewall and the socket state, which costs the same standing as changing them.
Both report when given no keyword#
remote.ssh
remote.api
With no keyword each reports the current state and changes nothing. This is the supported way to answer "how is this machine set up?"
remote.ssh#
remote.ssh {on | off}
on |
other computers on the network may connect over ssh |
off |
only this computer may connect |
It moves the firewall rule and never the ssh server itself. sshd is
the distribution's own service, and an administrator's own shell may be
reaching this machine through it right now — there is nothing here
resembling SD Core for Windows's ssh.server install/remove, because
installing or removing packages is the distribution's job, not SD's. The
rule this verb moves is the one the installer itself wrote (ufw allow
22/tcp, or firewalld's port 22/tcp where firewalld is the firewall). Where
firewalld's own ssh service also lets ssh in, remote.ssh off
removes only SD's rule and says that the ssh service still allows it,
rather than remove a rule SD did not make.
Where the firewall gates nothing, this refuses rather than lie about
it. With no firewall (ufw or firewalld), an inactive one, or one already allowing incoming
connections by default, a rule change for port 22 changes nothing about
who can actually connect — and reporting "remote ssh access is now OFF"
in that state would be exactly the reassuring falsehood a verifier must
never print. The verb exits with a distinct status (3) having changed
nothing, prints what the firewall actually says, and names why.
Administrator only, and every change is audited, the same as
remote.api.
remote.api#
remote.api {on | local | off}
on |
SD listens on port 4247 on every address, and the firewall allows it: other computers may connect |
local |
SD listens on 127.0.0.1:4247 only: only this computer may |
off |
SD opens no API socket at all, TCP or local |
There are two axes here and the verb sets both, the same shape as SD
Core for Windows's verb of the same name — the mechanism is entirely
different underneath. Whether SD listens at all is systemd's
sdclient.socket unit; who may reach it is the firewall — ufw, or
firewalld. The verb drives both and
reads them back, so what it reports after a change is the machine's own
answer, not the verb's intention. The firewall rule is the installer's own
(ufw allow 4247/tcp, or firewalld's port 4247/tcp, kept in its saved
settings), so this verb and the install describe one state.
The local Unix socket is for SD users only. /tmp/sdsys/sdclient.socket is mode 0660, group sdusers: the operating system refuses a connection from
anyone else (root excepted) before SD sees it. Until 2.0-0 the unit named the group but not the mode, and systemd then makes a Unix socket 0666, so the
group restricted nothing and anybody on the machine could reach the first stage of an API connection, which runs as root. remote.api on, local and off
do not change the mode. A person who has just been added to sdusers must log out and in before the socket lets them through, as for the rest of the data
tree. The installer adds SocketMode=0660 to an existing sdclient.socket that has no SocketMode= line, and never touches one that has; to widen it on purpose,
systemctl edit sdclient.socket and write SocketMode= in the drop-in. ls -l /tmp/sdsys/sdclient.socket shows the mode.
The first stage of a connection is confined. The unit that starts one server for each connection, sdclient@.service, sets the safe part of systemd's
sandbox: ProtectKernelTunables, ProtectKernelModules, ProtectKernelLogs, ProtectControlGroups, ProtectClock, ProtectHostname, RestrictRealtime, RestrictNamespaces,
LockPersonality and SystemCallArchitectures=native. That stage runs as root until a session has logged in, so a fault in the reader would otherwise have all of root's reach; these
settings take from it what it never uses. They are not the whole sandbox, on purpose: NoNewPrivileges and a capability bound would stop the sudo sd-elevate that a session
runs, and ProtectSystem, ProtectHome and PrivateTmp would stop it writing the system directory and the accounts. A fresh install has the settings; an upgrade that keeps the
unit files keeps the old one - copy usr/lib/systemd/system/sdclient@.service from the source over /usr/lib/systemd/system/sdclient@.service and run systemctl daemon-reload
(systemctl show sdclient@x.service -p RestrictNamespaces says yes when it is in force). To loosen one, systemctl edit sdclient@.service and set it to no in the drop-in.
No SD session is ever ended by this verb, which is where it differs
most from the Windows original. SD Core for Windows's own listener opens
only when SD itself starts, so changing it there restarts the whole
program and ends every session, the caller's included — and asks first.
Here the listener belongs to the socket unit, not to any running sd
process: on and local restart the socket, and off stops it. A
connection already accepted is its own separate service instance, so
nothing already talking to the API is disturbed by a later change.
Administrator only — the same gate modify.account uses, because this
changes what the machine offers the network rather than anything about one
account — and every change is audited.
What a connection costs while nobody has logged in. Each API connection is one sd -n -q process, running as root until the client has logged in, and it is there before any login is checked. It ends when the connection does, and refuses a request that declares a length over 65,536 bytes (after the login the limit is the largest SD string; the client page, How big a request may be, has the rules), leaving a line in the system log. A count of sd -n -q processes that does not fall back to the number of clients is the sign of a connection that did not end. A client that connects, completes the handshake and then says nothing is still left waiting: SD sets no time limit on a connection that has not logged in, and remote.api local or the firewall are what keep it to the people you intend.
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 the socket unit and the firewall, not what the page meant. A changes the API (on, local or off), S changes ssh (on or off), each chosen from a list that 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. It only shows: the switches are tool.gates's |
3 servers |
the SDNet servers of the netservers file (read with !netdefs): 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 its hash 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 sdsys login |
what remote.sdsys says with no keyword: whether the ssh door lets sdsys in with its password (shut as delivered). O opens it (its box wants the word open typed), F shuts it. See Remote Administration over ssh. Below the report are two fields, Local ssh users and Local API users: the Linux 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 |
The page runs these commands 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): remote.api,
remote.ssh, delete.server, remote.sdsys on, remote.sdsys off and local.sdsys with add, remove
or clear, besides the reports. set.server
is run by the verb itself on the terminal. The verbs ask for the administrator again and write their own audit lines; the page writes
nothing. A door that the firewall cannot gate is refused by remote.ssh, and the page shows the
verb's words. F5 reads everything again, F1 explains the page and Ctrl-Q leaves. While the page reads the state of
ssh, the API and the sdsys login, which can take a few seconds, the status line says
"Reading the settings (a few seconds)..."; the page's own message comes back when the reading is done. While a
change runs, the status line says "Making the change (a few seconds)...".
Opening the page writes the audit line tool start app=tool.remote.
When a change fails#
Both report a failure rather than falling silent, and name what did not
happen. remote.ssh exits 3, unchanged, when the firewall would not have
gated anything anyway (see above) — a refusal, not a silent success.