# Terminal and file manager

> A recorded browser terminal and a file manager with an editor, permissions and archives in users' homes, and the whole server as root behind your passkey.

## Terminal

Open **Terminal** (in the server header or under **Tools**), choose the **User** and click **Open terminal**. You get an interactive shell on the server in the browser, opened by a signed job.

- Sessions run as the chosen user and end after **15 minutes without activity** or after **4 hours**.
- A **root** shell (or a sudo user's) needs your passkey: approve it, then click **Connect**.
- **Disconnect** ends the session.

### Recorded sessions

Every terminal session is recorded — screen output only, never keystrokes — and stored encrypted with your organization's key. Under **Recorded sessions**, **Replay** plays a session back (with pause and playback speed) and **Download .cast** saves it in the asciinema format. Viewing a recording is written to the audit log.

Recordings are kept **90 days** by default. Owners and admins can shorten this for the whole organization with **Delete recordings older than**: 7, 30 or 90 days (the 90-day default is the longest). A nightly job then deletes the older recordings and logs how many it removed.

Owners and admins can also delete recordings by hand. Click **Delete** on one session, or tick several and click **Delete selected**, then confirm with **Delete for good**. The recorded output is erased permanently and cannot be recovered. The session stays in the list, so you can still see who opened it and when, and the deletion is written to the audit log. Developers can replay and download recordings but cannot delete them. A session that is still open cannot be deleted until it closes.

## File manager

**Files** browses and edits files in a user's home directory.

1. Choose the user; their home directory opens. The list has your sites' users, the server users you created (except sudo users, whose files are root's code) and `www-data`.
2. Click folders to open them; the path above the list takes you back up. Under the path bar the panel shows the full path of the open folder on the server, and an open file has its full path too, each with a **Copy path** button. It is the path `ls` shows on the server (for example `/home/<user>/sites/example.com/current`), not a path relative to the home directory.
3. Click a file to open it in the editor (with syntax highlighting for PHP, JavaScript, JSON, YAML, HTML, CSS and Markdown), change it and **Save**.
4. **Upload** adds files from your computer to the open folder — up to 1 GB each, with a progress bar. Large files go to the panel first, then the server fetches them once over HTTPS and checks their SHA-256; a file with the same name is never overwritten.
5. The pencil **renames** a file or folder; **Create folder** and **Create file** add one (a new file opens in the editor). **Delete** asks you to confirm with **Delete for good**.
6. The shield edits **Permissions**: read, write and execute for owner, group and others, or the octal form (`644`, `755`). On a folder, **Apply to everything inside** changes its contents too and keeps folders openable. Setuid, setgid and sticky bits are never set.
7. The archive icon **extracts** a `.zip`, `.rar`, `.tar`, `.tar.gz`/`.tgz`, `.tar.bz2`, `.tar.xz`, `.tar.zst` or `.gz` file into a folder you choose (by default one named after the archive). Existing files are kept unless you tick **Replace existing files**.
8. **Search** finds files below the open folder by part of their name, by text inside them, or both (up to 500 results). It runs as the folder's user and does not follow links; click a result to open its folder or the file.
9. Tick files and folders, then **Compress** to pack them into a new `.zip` or `.tar.gz` in the open folder.

Archives unpack as the folder's user and stay inside the home directory: entries that would land outside it, links, device files and setuid bits are skipped, and an archive may unpack to at most 20 GB (less when the disk has less to spare). Long jobs show **Working on the server…** until the server reports the result.

A symbolic link to a folder opens like the folder when it leads to another folder inside the same home directory; links that lead elsewhere are not followed. Access is confined to that user's home directory: links and paths that lead outside it are refused by the agent. Site files live in `/home/<site user>/sites/<domain>/` — choose the site's Linux user to edit them. The `.ssh` directory is never readable.

### System files (root)

Choose **System files (root)** in the user list to open the whole server as root: browse from `/` (it opens at `/etc`, or type a path and **Open**), read any file in the editor and see each item's owner, group and permissions.

- Every change — **Save**, **Create file** or **Create folder**, rename, delete, permissions (including setuid/setgid/sticky for root) and **Owner** (user and group, optionally for everything inside) — waits for your passkey approval, right there on the page, then shows the result.
- nginx and PHP-FPM files are tested when you save (`nginx -t`, `php-fpm -t`); if the test fails the previous file is put back and the error is shown. Reload the service (for example under **Services**) to apply a change.
- Password hashes, private keys (TLS and SSH), host keys and the agent's own files are never shown or changed, also through a link.
- Files Zefily manages (a site's nginx file, a PHP pool) are rewritten when you change the matching setting in the panel; for lasting changes to a site's nginx file use [custom nginx](/docs/custom-nginx) or [custom OpenLiteSpeed](/docs/custom-openlitespeed).

For files over 1 GB or whole folders, use SFTP with a server user (an **SFTP only** user keeps it to file transfer — see [Firewall, users and SSH keys](/docs/firewall-and-users)), or deploy your code from Git.

## Open a site's files

On a site's page, Open files opens the file manager in the site's own folder: /home/<site user>/sites/<domain>. For an app
site that folder holds current/ (the live release), shared/ (its .env and uploads) and releases/.

---
Source: https://zefily.com/docs/terminal-and-files
