# User connection groups

A user connection group is a separate set of users. One server can have several: each has its own users, its own `default` user, its own templates and groups. Every listener belongs to one connection group, and only the users of that group can log in on that listener.

A new server has one group, **MainUsers**, and all listeners are in it. Most servers never need a second.

## What it is for

| Situation | With connection groups |
|---|---|
| two companies, or two departments, on one server, who must not share anything | a group each, on an address or port each. The same user name can exist in both and be two different people. |
| a test set of users beside the real one | a group `Test` on a port only you use |
| partners on one address, staff on another, with different rules for everybody | a group each, with its own `default` user |

It is a stronger separation than [groups](Users-Groups.md) and templates inside one set of users: nothing is inherited across, and an administrator of one need not see the other.

## Making one

In [IP / Servers](Ports.md), below the list of listeners, is the card **User Connection Groups**: "The groups a listener can be assigned to. A listener's own group is set on its General tab."

| Control | What it does |
|---|---|
| the list | the groups that exist |
| **Add** | makes a new, empty group |
| **Remove** | removes the selected group |

Then:

1. Select a listener, and on its **General** tab choose the group under **User Connection Group**. Add a listener for the new group if it shall have a port of its own.
2. **Save.**
3. In the [User Manager](Users.md), choose the group in the selector above the user list, and make its users. A new group starts with nothing: make its `default` user first.

Each group is a folder of its own in the server's `users` folder.

## Choosing the group by the request

Two special choices in a listener's **User Connection Group** list let one listener serve several groups:

| Choice | The group is |
|---|---|
| **@AutoDomain** | named after the domain part of the name the person logs in with: `alex@acme.example` is looked for in the group for `acme.example` |
| **@AutoHostHttp** | chosen by the host name the browser asked for: see [IP / Servers](Ports.md#user-connection-groups) |

With these, several customers can use the same port and still be in sets of their own.

## The group ConnectionProfiles

The list also shows **ConnectionProfiles**. It is not a set of people: the server keeps its saved connections to other systems there, one "user" per connection. See [Connection profiles](Connection-Profiles.md). Do not assign a listener to it, and do not remove it.

In jobs, a saved connection is written `{connect_start}NAME{connect_end}`, with a folder after it if needed. A task so names a partner's server without holding its address and password.

Another reserved group, `extra_vfs`, holds the additional file systems of users: see [Merged VFS](VFS-Merged.md).

## Things to know

- Administrators belong to a group too. An administrator of `MainUsers` manages every group; give the administrators of another group [roles](Prefs-Access.md) that reach only their own.
- Server-wide settings, such as bans, password rules of the server and the look of the web interface, hold for all groups. What differs per group is what its `default` user and its login page say.
- A share, an event or a job that names a user means the user of **that** group.
- Moving a user from one group to another is copying its folder; do it with the server's tools, not by hand, and check its inheritance afterwards.
