SD Core for Linux LC2.0-0

Remote Administration over ssh

How SDSYS, the administrator, can sign in over ssh from another computer with its password; how to turn it on and off; what it refuses; the risk; and what can stop it working.

SDSYS can sign in over ssh from another computer, but only after you have opened that door. As delivered the door is shut: sdsys is refused a network login at the ssh server. The installer does not ask about it; open it as "Opening and shutting the door" below says. An upgrade that keeps the configuration leaves it as it was: open stays open, shut stays shut. A full uninstall removes it. Once you open it, a sign-in over ssh asks for sdsys's password and lands in an SD session with every right the local SDSYS has.

Open it with care: with the door open, nothing but the sdsys password stands between the network and the administrator. Open it only on a machine whose sdsys password is long and used nowhere else, and shut it again when it is not needed. SD asks for no second factor here; earlier test versions of this release did, and it was taken out because it was more security than the people who run SD wanted.

The API is a separate door. SDSYS over the API from another computer is shut as delivered too, and is opened with remote.sdsys api on, for chosen addresses; it is described on its own page, Remote Administration through the API. This page is about ssh.

Reaching SDSYS from a listed user's own login on this computer is a third, separate thing, off as delivered, described in Reaching SDSYS from Your Own Login.

This page is about SD Core for Linux. SD Core for Windows has the same door in its own form: there the administrator is an elevated Windows account, so the door opens a separate account that signs in over ssh only and is never elevated; its own documentation describes it. Neither SD Core Solo for Linux nor SD Core Solo for Windows has it.

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.

What a sign-in looks like#

$ ssh sdsys@server
Password:

Opening and shutting the door#

You need root for this: either the machine's own administrator account (sudo), or sdsys signed in at the machine itself. Nothing here needs an ssh session as sdsys, so a server with no screen and no keyboard is set up from your ordinary ssh login.

sudo /usr/local/sbin/sd-elevate sdsys-ssh on
sudo /usr/local/sbin/sd-elevate sdsys-ssh off
sudo /usr/local/sbin/sd-elevate sdsys-ssh status

on writes the ssh settings described below, checks with sshd itself that the result is what it meant, and only then reports success. If the check does not come out right, the file is put back exactly as it was and you are told why (see "What can stop it"). off shuts the door again: sdsys is denied a network login. status says which it is now (sdsys-arm=open or closed).

From inside SD: remote.sdsys#

SDSYS signed in at the machine can do the same without leaving SD:

remote.sdsys {on | off}
remote.sdsys ssh {on | off}
(no keyword) says whether ssh lets sdsys in, and whether the API does, and changes nothing
on, ssh on opens the door, as sdsys-ssh on does
off, ssh off shuts it, as sdsys-ssh off does
ssh says whether ssh lets sdsys in, and changes nothing

The same is the sixth view of tool.remote, 6 sdsys login: it shows the report, and O and F run remote.sdsys on and off after a box (the box for on wants the word open typed).

Each use writes one audit line, remote.sdsys on status=0 and the like: the keyword and the helper's exit status.

What SD changes on the machine#

ssh-forcecommand --remove takes SD's block out.

A machine that an earlier test version set up#

Earlier test versions of this release asked a second factor, a code from an authenticator app, and left lines in /etc/pam.d/sshd and in the console sign-in files, a module in /usr/local/lib/sd, and files under /etc/sdcore/totp* and /run/sdcore. The installer cleans all of it on an upgrade: the sdsys arm is written shut, the lines are taken out of the PAM files (byte for byte as they were before), and only then are the module and the files removed, because a PAM line naming a missing module would fail a sign-in. If that cleaning could not be done the installer says so and leaves the module where it is; run sudo /usr/local/sbin/ssh-forcecommand --clean-legacy once the cause is resolved. After an upgrade the door is shut; open it again if you want it.

What still refuses#

What can stop it working#

Turning it on asks sshd what it would do with sdsys and refuses, with nothing changed, if the answer is not the one SD wrote. It names the cause. The ones that happen:

What it does not do#