SD Core for Linux LC2.0-0

SDNet

The NET switch and the server definitions: what is in place for files on another SD server, and what is not there yet.

SDNet is the name for opening a file that lives on another SD server and using it with READ, WRITE, SELECT and LIST as if it were local. This release has the permission (the NET switch), the list of servers, a person's own login on a server (set.netlogin, kept as values derived from the password and never as the password), and a VOC pointer of type N that opens a file on a defined server: for reading, selecting and querying, and, only for a server defined write whose administrator has also put the remote user in the Linux group sdfileswrite, for writing and locking. On the server side there is a second, narrower API route, sdfiles, which lets a login work with files and do nothing else. The pieces that are not there are listed under "What does not exist yet". Behavior that depends on your own network is listed in Known Limits.

SD has no server;file VOC entry over port 4245 with each server's password in sd.conf, which any local user could read. This is not that. Nothing of that kind exists: there is no ; in a path, no port 4245 and no password in any file.

What SDNet is#

What is in SDNet#

the NET switch modify.account name net-on / net-off, and net-on in create.account user. See Accounts and Security
the server definitions one file, netservers, in the SDSYS directory
set.server adds a definition, or replaces one
delete.server removes one
list.servers shows them
set.netlogin a person makes their own login on a defined server: SD runs the SCRAM exchange once and keeps the derived values (see "Your login on a server")
delete.netlogin removes it
sd-elevate netcred-dir the privileged helper step that makes the directory the logins are kept in
the files-only route the Linux group sdfiles, on the server being reached: modify.account name files-on / files-off, and files-on in create.account user. See "The files-only route on a server" below

The first three verbs are SDSYS's. They are in SDSYS's VOC and in no other account's, and each one also stops with "Command requires administrator privileges" for anyone who is not the administrator. set.netlogin and delete.netlogin are in every account's VOC, because they are for the person whose login it is; the gates they ask are described below. Commands are shown here in lower case.

What does not exist yet#

The security model#

Nothing a user can type chooses a host. The only machines SD will ever be asked to call are the ones SDSYS has written down, and only SDSYS can write them: the file is replaced only by these verbs, and the verbs are SDSYS's. A program cannot define, change or point at a server. (set.server ... connect is the one connection that takes a host as typed: it dials the host SDSYS typed, for a handshake, and sends nothing. Every other connection goes to a defined server.) Two things must then both be true before an account can use one: it has the NET switch (off by default), and it is named in that server's accounts list (empty by default). Neither is a judgment that nobody should have the capability; each is a decision about who decides, and it is yours.

The file holds no secret, and must never hold one. A definition is a name, an address, a port, the name of an account, and the hash of a public key. The file is readable by every user (mode 644) on purpose, and only the sdsys user writes it. A person's login on a server is kept somewhere else, in a file only that person can read (see "Your login on a server").

The file: netservers#

It is a plain text file in the SDSYS directory (/usr/local/sdsys/netservers on a standard install), one definition to a line, at most ten:

name|host|port|account|pin|mode|accounts|created

It is always written whole: the new text goes to netservers.new beside it and is renamed over the old file, so it is never half written. A session that changes it holds a lock for the length of the change (a second administrator session that tries meanwhile is told to try again). The mode of the new file is 644 whoever asked, and the file is owned by whoever ran the session, which is sdsys.

field rule
name a lower case letter, then up to 15 lower case letters or digits. Capitals typed are converted
host 1 to 253 letters, digits, dots, hyphens or colons: a DNS name, an IPv4 address or an IPv6 literal. It does not start with a hyphen or a dot. Capitals are converted
port a whole number from 1 to 65535: the port of the server you are defining, chosen when you define it (4247 for a full SD Core, 4249 for a Solo). SD does not insist on either number. 04249 is stored as 4249
account the account to enter on the remote server: 1 to 32 letters, digits, dots, underscores or hyphens. Kept as typed, because the other server's names are its own
pin the SHA-256 hash of the server's public key: exactly 64 hexadecimal digits, stored in lower case. A new certificate with the same key keeps the same pin
mode read or write. read unless write is given. What a program may do with the server's files, once it can open them
accounts the local accounts that may use the server: registered account names separated by commas, no spaces, no empty name, at most 2000 characters, each listed once. Empty means nobody, and empty is what you get unless you list some
created the date the definition was made, yyyy-mm-dd. Set by SD

No field may hold a vertical bar, a control character or a character above the ASCII range, so a line cannot be made into something else.

Continued in#

SDNet: Servers — set.server, delete.server and list.servers.