berth

Databases and files

Files, FTP, SFTP and SSH

The browser file manager, FTPS with extra accounts per folder, SFTP and SSH with or without a sandboxed shell, SSH keys kept out of the webspace, a second factor for SSH (TOTP or FIDO2), live sessions you can end, and the browser terminal.

Updated 6 min readsftp · ftp · ftps · ssh · file manager · terminal · ssh keysView as Markdown

On this page
  1. Where the files are
  2. File manager in the browser
  3. FTP with TLS
  4. SFTP and SSH
  5. A second factor for SSH and SFTP
  6. Who is connected now
  7. Terminal in the browser
  8. Which to use

There are four ways to get at a subscription's files: the file manager in the browser, FTP with TLS, SFTP, and a shell over SSH or in the browser. All of them run as the subscription's own system user and see only that subscription's webspaces, so a mistake or a stolen password stays inside one customer's files. This page explains each one and the protections around them.

Where the files are

Each subscription has a webspace under /var/www/vhosts/<domain>, owned by its system user, with the website in httpdocs (or the document root you chose). The layout is the same as on Plesk; see On-disk layout.

File manager in the browser

The domain's Files tab is a file manager that works as the subscription's system user:

  • browse, search by name or by text inside files (Search in all subfolders);
  • upload files, and unpack zip and tar archives in place (Extract here);
  • edit text files, rename or move (Rename or move…), copy, pack into zip or tar.gz (Pack…), and delete;
  • change permissions (Permissions…), with guidance: 640 or 644 for a normal file, 750 for a directory, 600 for a secret;
  • move a suspicious file into quarantine (Quarantine).

Uploads and unpacked archives are scanned for malware as soon as they are written; a find is reported and, if the administrator has chosen so, moved to quarantine. See Malware scanning. Changing permissions never follows symbolic links, and copying a link copies the link itself. Large files go through SFTP.

berth files list --domain example.com --path httpdocs
berth files upload --domain example.com --path httpdocs/robots.txt < robots.txt
berth files extract --domain example.com --path httpdocs/site.zip
berth files fixperms --domain example.com --path httpdocs

fixperms resets permissions under a path to the safe default: the owner reads and writes, the group reads, nobody else writes, secrets 600. Administrators also have a server-wide file manager under System → Files.

FTP with TLS

FTP runs on ProFTPD and only works encrypted, as FTPS with explicit TLS. Plain FTP is refused, so passwords never cross the network in clear text.

SettingValue
Serveras shown on the domain's FTP page
Port21, passive mode, with explicit TLS ("FTP over TLS" in FileZilla)
Main accountthe subscription's system user, with the SFTP password (the whole webspace)

Extra FTP accounts

On the domain's FTP page you create extra accounts, for example for a web designer, each limited to one folder:

  1. Under Add account, enter a name (3 to 32 characters: lowercase letters, digits, dot and hyphen) and the folder inside the webspace.
  2. Leave the password empty to have a strong one generated; it is shown once.
printf '%s\n' "$PW" | berth ftp add --sysuser acme --name designer --path httpdocs/shop --password-stdin
berth ftp list --sysuser acme
berth ftp password --name designer
berth ftp remove --name designer

The package sets how many extra accounts a subscription may have (berth plan set … --max-ftp-users). FTP is an optional component; servers installed with --no-ftp don't offer it.

SFTP and SSH

SFTP is the recommended way to transfer files: one encrypted connection, easy through firewalls, and it works with keys. Customers connect on a separate SSH port for customers, shown in the panel; port 22 is reserved for administrators and only accepts connections over a VPN.

The domain page's card SFTP and SSH shows the server, the port, the username (the subscription's system user) and the folder of the website. Set a password with Set password; it is shown once and stored nowhere in readable form.

berth sftp password --sysuser acme

Without or with a shell

What a login can do depends on the package:

  • Without shell (the default): SFTP only. The user is locked into the webspace (a chroot with sshd's internal SFTP server) and cannot run commands.
  • With shell (berth plan set … --shell): SSH gives a real shell, plus rsync, git and SFTP with real paths. The shell runs in a sandbox: a transient systemd unit inside the subscription's own slice, so it shares the subscription's CPU, memory and process limits. The user sees only their own webspaces, not the panel and not other users' processes. It is the same environment as the browser terminal.

See Isolation for how subscriptions are kept apart.

SSH keys managed by the panel

Under SSH keys on the domain page, paste a public key (the .pub file) to log in without a password. Accepted are ed25519, ECDSA, RSA from 2048 bits, and FIDO2 security keys (sk-ssh-ed25519, sk-ecdsa).

The keys are stored outside the webspace and written by the panel, each with sshd's restrict option. A script on the website therefore cannot plant its own key, which is a common way attackers keep access after breaking into a site. Keys in a .ssh/authorized_keys inside the webspace are not used; when you migrate from Plesk, the panel takes them over as panel-managed keys.

berth sftp key add --sysuser acme --name laptop --file ~/.ssh/id_ed25519.pub
berth sftp key list --sysuser acme
berth sftp key remove --sysuser acme --id 4

A second factor for SSH and SFTP

A second factor makes a guessed or leaked password or key useless on its own. It is optional and separate from the panel's own two-step verification: signing in to the panel never unlocks SSH, and the other way round. Open Two-step verification for SSH from the SFTP and SSH card and choose:

  • Authenticator app (TOTP): scan the code with an app, confirm with a code, and store the recovery codes shown once. SSH then asks for a password or key and a code.
  • FIDO2 keys: add a security key created with ssh-keygen -t ed25519-sk -O verify-required. Logging in then needs the key and its PIN; ordinary keys and the password no longer work for SSH.
berth ssh 2fa totp --sysuser acme                  # shows the secret and otpauth URL once
berth ssh 2fa confirm --sysuser acme --code 123456 # returns the recovery codes
berth ssh 2fa fido2-add --sysuser acme --name yubikey --file id_ed25519_sk.pub
berth ssh 2fa status --sysuser acme

Lost the app? Use a recovery code, or ask the reseller or administrator to reset it (berth ssh 2fa reset --sysuser acme). FTP cannot ask for a second factor, so once a subscription has one, its main account can no longer sign in over FTP; use SFTP. Extra FTP accounts keep working.

Who is connected now

SSH sessions, with the heading Who is in, lists the live SSH and SFTP sessions of a subscription: the source address, whether it has a terminal, and since when. End closes a session immediately, for example after a password leak or when a former contractor is still connected.

berth ssh sessions --sysuser acme
berth ssh sessions --sysuser acme --terminate 7

Terminal in the browser

When the package allows a shell, the subscription has a Terminal in the browser, in the same sandbox as SSH: only the subscription's own webspaces, inside its slice. A terminal can also be opened inside one of the subscription's containers. Copy and paste work with the browser's normal keys, and opening and closing a terminal are recorded in the activity log.

By default a terminal opens only after a fresh confirmation, so a hijacked browser session alone cannot open a shell. The administrator sets this for the whole server (on by default) or per subscription; SSH from your own computer is not affected.

berth ssh 2fa terminal --server            # fresh confirmation for every terminal on the server
berth ssh 2fa terminal --server --on=false
berth ssh 2fa terminal --sysuser acme      # the same for one subscription

Which to use

TaskBest tool
Change one file quicklyFile manager
Upload a site or large filesSFTP
Give a designer access to one folderExtra FTP account
Deploy with rsync or git, run Composer or WP-CLISSH with shell, or Git deploy
Quick command without a local SSH clientBrowser terminal