# Sharing a Folder

_Peios / Using Peios / Sharing Folders_

> Share a folder with other computers on the network, with the File Sharing window or the fserv command, and check that it is reachable.

Share a folder when people on other computers need to open and save its
files. When you finish, the folder is reachable from Windows, Mac and Linux
computers by an address such as `\\peios-box\Projects`.

## Before you start

- Sign in as a member of Administrators. Only Administrators can change
  shares.
- Make sure the folder exists, and that its permissions let the people who
  will use it open its files. Sharing a folder doesn't change its
  permissions: [File Sharing](/peios/using-peios/sharing-folders/file-sharing.md) explains
  why.
- Each person who connects needs an account on this machine.

## Share a folder with the File Sharing window

1. Open **File Sharing** from the launcher. From a terminal, `fserv --window`
   opens the same window.
2. Choose **Share a folder** in the sidebar.
3. In **Folder**, type the folder's full path, such as `/srv/projects`, or
   choose **Browse…** to pick it.
4. In **Name**, keep the suggested name or type another. The name is part
   of the address people type, so a short name without spaces is easiest.
5. Leave **Network access** set to **No network restriction**, unless the
   share should be more restricted than the folder's own permissions.
6. Choose **Share Folder**.

The new share's page shows its addresses under **Connect**, and the file
server's state is on the **Service** page. If the file server is stopped,
choose **Start**, and turn on **Start when Peios starts** so the share is
available after every restart.

## Share a folder with the fserv command

1. Add the share:

   ```sh
   fserv share add Projects /srv/projects
   ```

2. If the file server isn't running, start it, and make it start at boot:

   ```sh
   fserv service start
   fserv service boot on
   ```

`fserv share add` refuses a folder that doesn't exist, a name another share
already has, or a name with characters that SMB doesn't allow, such as `/`
or `:`. Read `fserv(8)` for every option.

## Check the result

Run `fserv share show` with the share's name:

```sh
fserv share show Projects
```

The output includes `SMB on`, the access, and the addresses to connect to:

```text
Share           Projects
Folder          /srv/projects
SMB             on
Access          No network restriction
Windows path    \\peios-box\Projects
Mac/Linux       smb://peios-box/Projects
```

`fserv status` shows whether the file server is running. Then connect from
another computer, as described in
[Connecting to a Share](/peios/using-peios/sharing-folders/connecting-to-a-share.md).

## Stop sharing a folder

On the share's page in File Sharing, choose **Stop Sharing…**, or run:

```sh
fserv share remove Projects
```

The folder and its files stay where they are. People already connected
keep the share until they disconnect.

Related content:

- [File Sharing](/peios/using-peios/sharing-folders/file-sharing.md)
- [Connecting to a Share](/peios/using-peios/sharing-folders/connecting-to-a-share.md)
- [Restricting Network Access](/peios/using-peios/sharing-folders/restricting-network-access.md)
