SD Core for Windows WC2.0-0

Your first thirty minutes

From a finished install to a working account, a file and a second user signing in over ssh.

This page assumes SD Core for Windows is installed and you have never used it before. It is a walkthrough, not a reference — every step links to the page that explains it properly.

Do this first, before anything else.

1. Sign out of Windows and back in#

Not optional, and not a tidiness step. The installer put your Windows account into the sdusers group, and Windows fixes group membership when you sign in. Until you get a new logon token you cannot read the database at all.

The symptom looks like a broken install, not a permissions problem, which is why it is step 1. The post-install check knows this: the run it offers at the end of the installer is always the incomplete one, for exactly this reason.

Sign out, sign back in, then run Check the SD installation from the Start Menu. It closes on a keypress.

2. Start SD#

sd

You land in the SD account named after your Windows login. Nothing asks for a password — Windows has already authenticated you.

SD is already running. It is a Windows service, SD Core for Windows, and Windows starts it at every boot. You do not type sd -start. See Running SD.

If sd answers Account ... not in register, you are in the wrong account or step 1 has not taken effect. If it answers not registered for SD use, you are not in sdusers.

3. Look around#

who
list voc with type = "F"
term
who the account you are standing in
list voc with type = "F" the files in it
term your terminal type and page size — should say Device : windows

If term says something else and your arrow keys do not work, run term windows for this session and see Other hardening. An account keeps the terminal setting in its VOC until update.accounts updates it.

term also reports the page size, and SD's default is 140 × 43 — not 80 × 24. A console window narrower than that makes wide reports look wrapped or truncated and the report is not at fault. SD's own full-screen programs (sed, ced, ide, the home screen) want a window of at least 140 columns by 43 lines, which is the size SD's own window starts at: SD always runs in a window of its own, whether from the Start Menu or typed at a prompt (see Running SD). For full screen, press Alt+Enter (in SD's window F11 goes to SD). If a report still looks cramped, widen the window, or set it for the session with term default — which puts the 140 × 43 back and prints nothing while doing it, so check with a bare term afterwards. term 140,43 is the same thing typed out. See Other hardening.

4. Make a file and put something in it#

create.file customers
ed customers 1001

ed is the line editor, and it needs nothing installed. For a full screen, sed is SD's own editor, with drop-down menus, and needs no operating-system permission (see The SED Screen Editor in the User set); edit opens the same record in Microsoft Edit and micro opens it in micro, and both come with SD. See Development and file commands. The old full-screen editors update.record and modify are gone; see Not in SD Core for Windows.

In ed: i to insert, type your lines, a full stop on its own line to stop inserting, then fi to file and exit.

You do not have to write programs in ed. An account's bp file is a directory file — an ordinary Windows folder with one file per program — so Notepad++, VS Code or any text editor works on it just as well:

C:\ProgramData\SD\user_accounts\<account>\bp

Save the file, then basic and catalog it from inside SD as usual. SD folds CR+LF line endings on the way in, so a Windows editor's output needs nothing done to it — see Other hardening.

list customers
count customers

Commands are lower case now, and so are the VOC records behind them. Typing LIST still works — SD converts it. See Lower case.

THIS IS THE POINT AT WHICH MOST THINGS SHOULD FEEL LIKE OpenQM. If anything in ordinary data work behaves differently and is not described in this set, that is worth reporting.

5. Become SDSYS#

Leave this session — exit, or close the window — and start a new one signed in to Windows as SDSYS, the account the installer made. From that Windows sign-in, at the machine:

sd

started elevated, lands you directly in SDSYS. There is no logto route into SDSYS from any other account, however elevated — SDSYS's own Windows sign-in is the only way in. See Accounts.

IF YOU ARE OVER ssh, THIS WILL NOT WORK THE FIRST TIME. SDSYS itself has no ssh access, local or remote. Sign in at the machine itself, or through a remote desktop or remote-control product installed as a service. Once you are in, the administrator can open remote administration for the separate account SDRADMIN with remote.sdsys on (the Administrator documents, "Remote Administration over ssh", say how, and what it risks) and then sign in as SDRADMIN over ssh.

6. Create an account for somebody else#

create.account user jane ssh

Two things about that line, and each has caught people out:

the ssh word every new account starts with no ssh, no API, no shell and no OS.EXECUTE — yours too, the account the installer made for you, unless you ticked the installer's box that opens every gate for it. ssh gives Jane the ssh route she needs in step 7; add api, sh-on or os-on for the others (create.account user jane ssh sh-on), or turn any of them on later with modify.account. The same goes for saving a change to a VOC, a program file or a dictionary: voc-on, bp-on and dict-on allow it, one each, and until then the account can read them but not change them or compile programs. See Accounts
it needs SDSYS creating a Windows account cannot be done from any other identity

You will be prompted for Jane's password, masked. Refusing the prompt creates nothing at all — a user account cannot exist without a password.

The password is the one Jane signs in with over ssh, and over the API if she is given that route. Every account gets the same VOC — there is no programmer/standard choice to make any more.

7. Sign in as Jane#

ssh jane@localhost

You land directly inside SD, not at a Windows prompt. That is the forced command, and it applies to everyone who can reach ssh at all.

Jane cannot log in to Windows at this machine. She is denied the console and Remote Desktop by group membership, deliberately. She reaches SD over ssh or through an API client — which is what the ssh/api/both keyword chose. See ssh access.

ssh localhost needs no network and works on a machine with no network connection at all.

8. Leave#

off

What to try next, in rough order of how likely it is to find something#

  1. Your own application data. There is no restore utility, so the way in is a short BASIC program that reads your exported data and writes the records. Then query it — the query processor is where most of the surface area is.
  2. A client program against the API. Point it at port 4247. It needs a client library that speaks SCRAM, because there is no cleartext login. The architecture must match the application, and The DLL goes in the same directory as the application that loads it — Windows searches there before PATH. See API access and Client distribution.
  3. Locking an account down. Every account gets the full VOC now, so confining one to just your application is a hardening step you take by hand — see Security.
  4. An upgrade. Install over the top and check your data survived and update.accounts brought the VOC forward.

When something goes wrong#

Something SD did, and who did it audit, in C:\ProgramData\SD\sdsys
Diagnostics, and API connections errlog, same place
"the account was not created — what happened" sd-elevate.log, in C:\ProgramData\SD
The installation itself Check the SD installation on the Start Menu

Other hardening explains which log answers which question — they are not interchangeable.

When you report something, say which build. The release stamp is on the sign-on banner and in sd --version.