# Session rules

> Choose what a session may do on a daemon server, like recording, forwarding and idle timeouts.

This page covers what a session may do on a server running `nokkud`. Every daemon has its own rules. A server set up with `nk sync` follows its own `sshd_config` instead.

## Rules per server

Open the server in the web app to change them. That needs the **editor** role.

- **Record sessions.** On by default. See [Audit log and recordings](/docs/security/audit-and-recordings).
- **Port forwarding** and **agent forwarding.** On by default.
- **Public remote forwards** (gateway ports). Off by default.

A change reaches the daemon right away, no restart needed. Sessions that are already running keep the rules they started with.

## Defaults for new servers

A new daemon starts with the workspace defaults. An admin sets those on the **Daemon defaults** settings page. Changing the defaults doesn't touch daemons that are already enrolled.

## Close idle terminals

On the same page, an admin can have every daemon end a terminal session after a while without a keystroke. Many security policies ask for this. It applies to all daemons at once, and a daemon keeps it while the core is unreachable. It may not be enabled on every instance.

Only sessions with a terminal count. `ssh host command` without one, file copies and port forwards keep running however long they take. A running job in a terminal with nobody typing is closed too, so start long jobs in `tmux` or `screen`.

On a server set up with `nk sync`, a shell timeout like `TMOUT` in `/etc/profile.d` does the same for shells.
