5. Files, sharing and file protocols
Files
Files shows your home folder, the shared folders you may open, USB drives and your remote folders, with your own permissions: you can do exactly what you could do over file sharing or SSH, and nothing more. Administrators also see the volumes and the whole system, under This server. Everyone with an account can use Files, unless App Permissions says otherwise.
- Open: double-click a folder to go in. Pictures, videos, music and PDFs open in the Viewer (the arrows go to the next file of the folder); text files open in the Text Editor. There, Tab indents the lines you chose (Shift+Tab takes it back; Esc, then Tab, leaves the text), and a file with Windows line ends keeps them when you save. Asked to open a folder that is not there any more (from a link to it, say), Files opens the nearest folder above it that is, and says so.
- Upload: the Upload button, or drop files onto the list. Each file shows its progress at the bottom right; its × stops it (a file still waiting is left out, and of the one being sent nothing stays in the folder).
- Action (or a right click): download, share, copy, cut and paste, zip and extract, rename, delete, Earlier versions..., Properties (with the permissions), and add a folder to favorites.
- Names you give (a new folder or file, a rename, an upload) must be ones Windows can show too: none of
\ : * ? " < > |, no space or dot at the end, and not CON, PRN, AUX, NUL, COM1 to COM9 or LPT1 to LPT9. Files that already have such names (copied over the network) keep them. - Views: a list or thumbnails; Hidden files shows names that start with a dot.
- Permissions in the properties: the owner, the group and everyone else, with the shared folder's access list. A Save there changes only Read, Write and Run (or Open): a folder that gives new files its group (setgid), or one where each person may delete only their own files (sticky), keeps that, and so does each folder and file inside.
Good to know:
- Copy and move: a copy or a move that fails partway leaves nothing half done in the target ("Nothing was copied."), so you can simply try again. A move to another volume copies first and then deletes only what it copied: a file someone saves into the folder meanwhile, or changes, stays where it was, and Files tells you how many. A file that another computer puts in the target under the same name while you copy or move is never replaced: Files stops and says so.
- Rename: changing only upper or lower case (photo.jpg to Photo.jpg) works on USB drives too. A shared folder itself is renamed in Settings > Shared Folders, where everything that uses it follows.
- Compress to zip: a folder inside that you may not open stops the zip, so nothing is silently missing from it. A name with characters that are not UTF-8 (from an old Windows computer) gets a replacement character in the zip, and Files says how many.
- Extract here: zips made on Windows, Linux or a Mac keep their names. An archive with a password, one compressed in a way Files cannot open, or a damaged one is said as such, and nothing is left behind.
- Text Editor: if someone else saved the file since you opened it, even a moment before, Save says so: reload it first. When the server stops in the middle of saving a file of someone else's, the old text comes back the next time the file is opened.
- Deleting for good, and changing the permissions of a folder with everything inside, can take a while for a big folder: a window shows how it goes, and closing it does not stop it (Background tasks, at the top).
Earlier versions
Earlier versions... of a file or folder lists what the snapshots kept, and what Desktop Sync kept when a computer changed or deleted the file. Open shows a version. Restore puts it back in place of what is there now:
- from a snapshot, the current file is replaced for good: copy it aside first if you want to keep it. A folder keeps what was added to it since: its files of then come back over today's (those deleted since too), and the files added since stay. If such a restore stops halfway (the volume full, say), today's folder is put back as it was, except a file someone saved while it ran: that stays as it was saved, and the message says where anything else is;
- from Desktop Sync, the version it replaces is kept too, and the computers get the restored file.
The recycle bin
In a shared folder with a recycle bin, what you delete goes to its Recycle Bin folder. Open it, and Restore puts a file back where it was (Shared folders). A shared folder itself is deleted in Settings > Shared Folders, not in Files. The Recycle Bin folder cannot go into itself: deleting it (alone or with other things) deletes for good, and the dialog says so; to empty it, open it and delete what is in it, or use Empty recycle bin in Settings > Shared Folders. A Time Machine destination has no recycle bin.
Search
The search at the top right of the desktop finds the names of your files and folders. For the words inside documents, choose the shared folders to read in Settings > Search Index: text, Markdown, HTML, PDF, Word, Excel, PowerPoint, OpenDocument, EPUB, RTF and email (.eml) files are read in the background, each file as its owner, and the results are always checked against the permissions of the person searching, on the very file that was read: you find what you may read, also when many documents you may not read match better. A file changed or put in another's place is found again once the next run has read it. Encrypted shared folders are never read. A file whose name is not UTF-8 is left out, and Settings > Search Index says how many.
Then search the words with Search contents in Files' toolbar (in the shared folder you are in, or Search every shared folder), or in the In documents results of the search at the top right.
Search Index also reads the details of pictures, videos and music, for thumbnails and for the apps that use them. What it could not read yet is read again at its next run once it can be: PDFs once the PDF reader is installed, videos once ffmpeg is, a file whose owner has an account now. The thumbnails of videos follow their switch: on, the next run makes them; off, none is shown from then on, and the next run deletes them.
Share links and file requests
Share in Files' toolbar (or Share link... in Action) makes a link to a file or a folder that anyone can open, even without an account:
- a share link downloads the file, or browses and downloads the folder, from a page that works on phones;
- a file request (for a folder) lets people send files into the folder and see nothing of what is in it.
Each link can have a Password, an end date (Ends on) and a Note shown on its page; a share link can also have a number of Downloads allowed. A file request takes at most so many files (Files at most: 500 unless you give another number), so large each (A file at most: 2 GB) and so much in all (In all at most: 20 GB), and it never takes the last free space of its volume (5 %, or 2 GB if that is less): a file over a limit is refused, and a request that took its files or its bytes ends. Raise them when you make it. A link uses the address you opened the desktop with, like https://nas.local:5001/s/.... From outside your network, the server must be reachable (a port forward or a VPN), with a name listed in Settings > Desktop Access (More host names).
Shared links, under Sharing at the left of Files, lists yours with how often each was used: copy a link, turn it off and on again (Turn off, Turn on), or delete it there. Administrators see everyone's. A link that ended (its end date passed, or its downloads were used up) stays in the list for a week, then goes; one you turned off stays until you delete it.
A link works as the account that made it: when that account can no longer read the file, or is locked or deleted, the link stops working. A link into a shared folder stops when the folder is deleted, and never opens a later shared folder of the same name; a link also never opens for a later account of the same name. Repeated wrong passwords pause a link for a few minutes.
- When the server is joined to a directory (Active Directory, LDAP) that does not answer, the links of its accounts stay, closed, and open again when it answers; they go once the account has been missing for a week.
- The page that made the last download a link allows can still finish or resume it (a video can still seek), until the server restarts. Another page gets nothing.
- A file request takes exactly as many files as it allows, even when many arrive at once; a file that comes after the limit, or after the request ended, is not kept. The sender sees the name they sent, never the name the file took (
plan (2).pdfwhenplan.pdfwas there): nothing tells them what the folder holds. Files called Recycle Bin or starting with a dot are refused.
Letting visitors drop files
For people passing by (a client with photos, a guest with documents), choose a folder and Let visitors drop files here... in Action (or the menu of a right click). It is a file request that ends by itself: Open for an hour, a day (the default) or a week, counted by the server's clock, with a Password and a Note for visitors if you want, how much it takes (the limits of a file request, above), and Tell me when files arrive. That tells you alone, not the Administrators: one note in your bell for the drop, brought up to date with each file and shown as new again; your phone if it gets your notifications, at most every 15 minutes across all your drops; and an e-mail at the same pace, only to an address an Administrator set for your account (Settings > Security > Account, Password reset by email, Edit). An address you typed yourself in My Account gets none: nobody checked it, and the server's mail would go wherever it says. The e-mail says only that files arrived; the bell says which, and where.
Then a large QR code shows: visitors scan it with their phone's camera and choose their files; they see nothing of what is in the folder. Address in the code chooses the address it holds: guest Wi-Fi is often kept apart from the office network, so choose one their phones can reach (the server's name on the internet if Settings > Desktop Access lists one, and the server is reachable there), or let them join the office network. Through OSM Connect, share links do not open at its address (unless Settings > Remote access lets them through): the code then holds one of the server's own addresses, and the desktop says so. Print a sign... prints a page with the code, the folder's name, your note and until when it is open, to put up at the reception. The drop is listed in Shared links like any link: turn it off there to close it early.
Remote folders
In Files' side bar, under Remote folders, Connect one... (or Manage...) mounts other storage in a folder of yours: an SMB share of another computer or NAS, an NFS export (Administrators only), or cloud storage. It can be read only, and mounted again when the server starts. Only you can open it in Files. An SMB password is kept where only the system can read it, a cloud's settings where only the system can change them and only your account can read them (OSM writes them again from what you saved each time it mounts the folder). A WebDAV address takes no account name or password: they go in their own fields. A WebDAV folder saved before that, with them in its address, has them moved into its fields by this update, and mounts as before.
The folder a remote folder is mounted in, and the folders above it, cannot be deleted, renamed, put in a recycle bin or moved to another disk while it is mounted: that would delete the files on the other computer. Unmount it first (in Manage...). Deleting files inside the remote folder works as on any folder. A remote folder is never mounted in the apps' data, which an app's uninstall deletes.
Remove (the bin, in Manage...) unmounts a remote folder and forgets it; its files stay on the other side. A cloud folder with files written into it that are not in the cloud yet is not removed: OSM says which, and asks again. Mount it again and wait until they are uploaded, or press Remove and lose them (through OSM Connect, after your second factor) when they can never be uploaded, a cloud account closed say.
File protocols: reaching shared folders from computers
They are in Settings > File Protocols: SMB, NFS and FTP each have a tab, with Install the first time you need it (Uninstall... is at the bottom of the tab after). Every account uses its own name and password; the shared folder's permissions decide what it may do.
SMB: Windows, macOS and Linux
- Windows: the server appears in Network in File Explorer. Or type
\\nas.local(the server's name) or\\192.168.1.20in the address bar, and sign in with your OSM account. - macOS: the server appears in Finder's sidebar. Or Go > Connect to Server and
smb://nas.local. - Linux:
smb://nas.localin the file manager. - Time Machine: tick A Time Machine destination for Macs in a shared folder's settings (and limit the size its backups take, if you want). Macs on your network then offer it in System Settings > General > Time Machine; each Mac signs in with an OSM account that has Read/Write access to the folder.
- Previous Versions: Windows shows the shared folders' snapshots in a file's or folder's Properties > Previous Versions.
A password changed in OSM is the file sharing password at once. Accounts made before File Protocols was installed get their file sharing password at their next sign-in to the desktop.
Macs also find the desktop itself in Safari's Bonjour list, at its HTTPS port: when you change the port in Settings > Desktop Access, the list follows.
Turning SMB off stops it now and at every start, and the server stops showing itself in Windows' Network and in Finder; turning it on again brings both back.
NFS: Linux computers and servers
NFS trusts the computer, not a password. Each shared folder has its NFS rules: which computers (an address, a network, or a name), read/write or read only, and what root on those computers becomes. The files keep their owners and permissions by number. NFS versions 3 and 4 are served. A computer named by its name must be found by the server (your DNS, or its hosts): a name it cannot find is refused when you save, and said again if it stops being found.
A computer reaches only the shared folders its rules are for: NFS checks every request against the folder. That check has a cost: a file renamed or moved while a computer has it open can give that computer a "stale file handle" error; open the file again. On a ZFS volume each shared folder is a file system of its own, so NFS needs no such check there, and serves the folder only while it is mounted.
Everyone gets Everyone's permissions (in Root on them) treats every user of those computers as one guest: each gets what the shared folder gives Everyone, whoever they are there. Root stays root only with Stays root; Is nobody (safe), the default, gives root nothing.
A rule of that kind saved with an older OSM (it was called Everyone is nobody) keeps the access it had: the users of those computers get nothing, as before. The rules list says everyone is nobody, saved by an older OSM, and the rule's row in Edit rules says to save it again: once you save the folder's rules, it gives them Everyone's permissions. A settings file or a full restore of an older OSM brings such rules back the same way.
FTP, FTPS, SFTP and rsync
FTP Server is for cameras, scanners and old programs; encryption (FTPS) is required unless you allow plain FTP. File names travel in UTF-8. SFTP and rsync over SSH come with the SSH server (Settings > SSH) and need no FTP at all. Over both, a standard account opens its shared folders by their path (/volume1/Photos): the volume does not list them.
Desktop Sync
Desktop Sync keeps folders of your computers in step with the server, and keeps the earlier versions of what they change or delete. It uses Syncthing, which runs on Windows, macOS, Linux and Android.
- Install Syncthing from the App Catalog. Its page in the App Catalog has a Desktop Sync section.
- On the computer, in Syncthing, Add Remote Device with the server's ID shown there (or scan its QR code with a phone). If the computer does not find the server by itself, give it the address shown there too.
- Share a folder with the server from the computer.
- On the server, the computer appears under Computers asking. Accept it: its folders arrive within a minute or two, each in a folder of its own in the sync shared folder (
<computer>/<folder>).
When a second computer shares a folder that the server already keeps for another computer (Syncthing gives the same folder the same ID on both, as with its own Default Folder), the server does not mix them by itself: the offer waits under Waiting, with the computers that folder belongs to. Sync with them... joins it, and that computer gets the files kept there and can change and delete them: do it for the same person's computers only. Ignore turns the offer down for good. A folder that cannot be taken (for example a file named like the computer is in the sync shared folder) also waits there, with why; the other computers' folders are taken all the same, and it is taken within a minute once the cause is gone.
Earlier versions are kept for the time you choose (a year by default) and show in Files under Earlier versions; restoring one sends it back to the computer too. Keeping them for less time deletes the older ones, so through OSM Connect it asks for your second factor again. Removing a computer stops its sync; its files stay on the server.
Media streaming
Settings > Media Streaming (Install there the first time) lets TVs, game consoles and music players on your network find the videos, music and photos of the shared folders you choose (DLNA/UPnP). They play without signing in, so choose only what anyone in the home may see. New files appear by themselves; what is in a recycle bin never shows, and neither does what someone made private in a folder. An encrypted shared folder cannot be chosen (its pictures', music's and videos' names and covers would be kept outside the encryption); one chosen before cannot be locked until you take it out of Media Streaming. Read the folders again (while Media Streaming is on) reads every folder from the start.