TFE Local Directory
Here's how to install the TFE Local Directory Linux agent, from logging into the server to getting your application running alongside it. Work through the steps in order. Each one builds on the last.
Before you start, check that you've worked through Prerequisites.
1. Server Preparation
Step 1: Log In to the Server
ssh <username>@<server-ip>
Enter the server SSH password.
Step 2: Make Sure the FUSE Feature Is Available
The agent needs the FUSE feature to protect folders.
# check whether FUSE is available
ls -l /dev/fuse
# enable FUSE if it is not yet active
sudo modprobe fuse
# enable automatically every time the server starts
echo fuse | sudo tee -a /etc/modules
If /dev/fuse isn't found and modprobe fuse fails, stop here and contact the server administrator. The agent can still be installed, but it won't be able to run, and the error you get won't mention FUSE as the cause.
Step 3: Copy the Installation Package to the Server
scp -r <package-folder>/ <username>@<server-ip>:~/
cd ~/<package-folder>
ls -l
Replace <package-folder> with the name of the installation package folder you received. Every command from here on runs from inside this folder, so before continuing, check that at least install.sh, uninstall.sh, takakrypt-fte, and takakrypt-fte.service are there.
Step 4: Grant Permission to Run the Installer
chmod u+x install.sh uninstall.sh
ls -l install.sh uninstall.sh
2. Running the Installer
Step 5: Run the Installer
Choose one of the three methods below.
a. Environment variables (recommended)
TAKAKRYPT_GATEWAY_AGENT_ID="" \
TAKAKRYPT_GATEWAY_ACCESS_TOKEN="<access-token>" \
TAKAKRYPT_GATEWAY_USER_KEY="uk_<user-key>" \
TAKAKRYPT_GATEWAY_TENANT="default" \
TAKAKRYPT_GATEWAY_ENDPOINT="https://<gateway-domain>" \
sudo -E ./install.sh fte --start
- The
-Eoption forsudohas to be there. Without it, your data gets ignored and the installer falls back to interactive question-and-answer mode. - Leave the Agent ID empty (
"") if you want the agent to register itself in the dashboard.
b. Bootstrap file
Prepare a tfe-config.yaml file containing the dashboard data (see Agent Configuration for its structure), then run:
sudo ./install.sh fte --bootstrap=/path/tfe-config.yaml --start
- The file gets copied to
/etc/takakrypt/fte/tfe-config.yamland made readable only by root. - Use the format starting with
gateway:, notcm:. The oldbootstrap-fte.yaml.templateexample uses thecm:format, and its contents get ignored.
c. Interactive
sudo ./install.sh fte
The installer asks for five things: Access Token, User Key, Tenant, Endpoint, and Agent ID. It cleans up the Endpoint address for you in two ways:
- No
http://orhttps://? It assumeshttp://. - A trailing slash gets stripped off, since it can break the connection to the gateway.
If your gateway uses HTTPS, write out the full address with https://, otherwise the installer treats it as http://.
Step 6: Enter the Server Password
[sudo] password for <username>:
Step 7: Wait for the Automatic Installation Process
| Stage | Process |
|---|---|
| 1 | Makes sure the agent program is available in the installation package folder |
| 2 | Stops the old agent that is currently running (if any) and makes sure it has really stopped |
| 3 | Releases leftover protected folders from a previous installation |
| 4 | Installs the agent program to /usr/local/bin/takakrypt-fte |
| 5 | Creates the configuration folder /etc/takakrypt/fte and the data folder /var/lib/takakrypt/fte/metadata |
| 5.5 | Saves the configuration file and restricts its access to root only |
| 6 | Installs the agent service and the log rotation settings |
| 7 | Enables the agent so it runs automatically every time the server starts |
| 8 | Starts the agent if --start was used, or the previous agent was already running |
If you run the installer against an agent that's already running, it gets restarted automatically, even without --start.
3. Agent Registration and Approval
Leave the Agent ID empty and the newly installed agent shows up as Pending in the Agent > Config menu and needs approval before it can be used.
Step 8: Register the Agent
# stop the agent first (enroll does not run while the agent is active)
sudo systemctl stop takakrypt-fte
# register, show the status, then finish
sudo takakrypt-fte enroll
# register, then wait for approval (Ctrl-C to stop)
sudo takakrypt-fte enroll --wait
# same as above, check the status every 30 seconds
sudo takakrypt-fte enroll --wait --poll=30s
| Exit code | Meaning |
|---|---|
0 | The agent has been approved |
2 | The agent is still waiting for approval (Pending) |
1602 | The waiting process was cancelled |
1 | Registration failed |
Step 9: Approve the Agent and Add the Protected Folder in the Dashboard
Which path you take depends on whether you filled in an Agent ID during installation.
Path A: the agent registers itself (Agent ID left empty)
- Open the Config menu. Open the Agent menu in the navigation panel, then select Config. The Config Agent page shows the Agent Management table.
- Approve the Pending agent. Find the agent with status Pending in the table. In the Action column, click the three-dot icon and select Manage, or click the agent name to open its detail page, then click Approve at the top right.
- Add the protected folder (mount point). On the agent detail page, click Edit at the top right. In the Mount Points section, click + Add Mount Point, fill in Protected Path with the folder's location (example
/data/sensitive; it has to match the folder you'll create on the server in Step 10 exactly), then select the Policy Name. Add more mount points if you have more than one folder. Click Save Changes, review the confirmation window, and click Save Changes again to finish.
Path B: the agent is created first in the dashboard (Agent ID filled in)
Here the agent gets created in the dashboard before you run the installer (Step 5), and its Agent ID goes into the install command.
- Open Agent > Config, then click Create New at the top right of the table.
- General Info: fill in Agent Name (example
Agent-Prod-01), select Account, select Access Token (available after an Account is selected), select Agent Mode = Directory, and fill in Description if needed. Click Next. - Mount Points: click + Add Mount Point, fill in Protected Path and select Policy Name. If the policy does not exist yet, click + Create New next to Policy Name. Click Next.
- Confirmation: review the data on the Review & Confirm page, then click Deploy Agent.
- Open the detail page of the newly created agent and copy the Agent ID from the bottom of the General Information card.
- For TFE Local Directory, always select Agent Mode = Directory. Object Storage is for TFE Object Storage instead. See TFE Object Storage.
- Active in the dashboard just means the agent has been approved. It's only truly ready once at least one protected folder has been added.
- Click Sync now at the top right of the agent detail page to push changes to the agent right away, instead of waiting for the next sync.
About policies (created in the Agent > Policy menu)
Policies go through four stages: General Info, Security Rules, Key Rules, Confirmation. For TFE Local Directory, pick Policy Type: Directory.
A policy defines which files are governed (Resource Set), who can access them (User Set), and which programs can (Process Set). All three have to match for the file contents to be readable, and that includes root, which doesn't get automatic access. Rules are evaluated top to bottom, and the first match wins; if nothing matches, access is denied, since every rule defaults to Effect: Deny.
When you set up a User Set, fill in UID and GID carefully, since the agent identifies users by those numbers, not by the Username or Gname fields.
4. Preparing the Protected Folder
Step 10: Create the Folder to Be Protected
sudo mkdir -p <protected-path>
sudo chown <app-user>:<app-group> <protected-path>
The agent won't create this folder for you. Skip it, and the agent may look like it's running fine while the application quietly fails to start with no clear error message. The folder owner also has to match the application user. PostgreSQL, for instance, refuses to run if its data folder is owned by root.
If the folder already has data and its application is running, stop the application first, let the agent move and encrypt the data, then start the application back up. Data is on the move during this process, so do it during a maintenance window.
5. Running and Checking the Agent
Step 11: Start the Agent
sudo systemctl start takakrypt-fte
sudo systemctl status takakrypt-fte
The agent only gets marked active once all protected folders are ready and their access rules applied, so this can take a moment. Don't worry if the first log entries show a failure while preparing a folder, because the encryption key just hasn't arrived yet, and the folder is ready shortly after.
Step 12: Check the Installation Result
| Command | Expected result |
|---|---|
sudo systemctl status takakrypt-fte | Status is active (running) |
sudo journalctl -u takakrypt-fte -f | Log entries run without repeated errors |
takakrypt-fte --version | Displays the version number, not "dev" |
mount | grep takakrypt | The protected folders are listed |
sudo takakrypt-fte status keys | The encryption key for each folder is available |
sudo takakrypt-fte status offline | Shows whether the agent is using cached data because the gateway is unreachable |
sudo takakrypt-fte status policy | The permitted users and programs match the plan |
sudo takakrypt-fte alerts | No alerts that require follow-up |
curl -s 127.0.0.1:9090/metrics | head | Agent monitoring data is displayed |
Then head to the dashboard: open Agent > Config and check the agent's detail page.
| Dashboard field | Expected result |
|---|---|
| Status | Active |
| Connection Status | Connected |
| Version | Agent version number, not "dev" |
| Operating System | Matches the server's OS |
| Last Heartbeat / Last Sync | Filled with the latest time |
| Mount Points | Each folder listed with the correct policy, location, and active status |
| Activity Log | Records approval activities and agent configuration changes |
Step 13: Check the Folder Protection Result
Log in as a user the policy permits, then compare what's in the protected folder against its companion .encrypted folder:
# each protected folder has a .encrypted companion
ls /
cd <protected-path>
ls
cat <file-name>
cd ..
cd <protected-path>.encrypted
cat <file-name>
The protected folder (what applications and permitted users actually open) looks normal, plaintext. The .encrypted folder (what's really sitting on disk) shows the same file as random characters.
A user or program the policy doesn't permit gets denied outright. And don't modify or copy files directly from the .encrypted folder. The only way to read them again is through the protected folder.
6. Running Applications Together with the Agent
Any application storing data in a protected folder has to start after the agent is running and stop before the agent does. Keep it running while the agent is down, and it'll write unencrypted data on top of encrypted data, causing permanent corruption.
Step 14: Install Additional Settings on the Application Service
sudo mkdir -p /etc/systemd/system/<app>.service.d
sudo cp takakrypt-guard.conf.template \
/etc/systemd/system/<app>.service.d/takakrypt-guard.conf
sudo systemctl daemon-reload
# make sure the result mentions takakrypt-fte
systemctl show <app>.service -p After -p BindsTo
- Install the settings on the service that actually runs the application. PostgreSQL on Debian/Ubuntu, for example, uses
postgresql@14-main.service, notpostgresql.service. - Don't touch the application's default service file directly, because those changes get wiped on the next update. Drop-ins under
/etc/systemd/systemsurvive updates.
7. Trusted Program Settings (Optional)
Step 15: Configure the host-settings.conf File
The optional /etc/takakrypt/fte/host-settings.conf file (example in host-settings.conf.template) spells out which programs, and their child programs, are trusted. Skip this file, and trust comes entirely from the policy in the dashboard.
# may verify logins; its child programs are also trusted
|authenticator|/usr/sbin/sshd
|authenticator|/usr/bin/login
# this program and all its child programs are trusted
|trust|/usr/sbin/mysqld
# trust all programs
|trust|*
# this program and its children are never trusted
|path_no_trust|/bin/ksh
path_no_trust always wins over other rules, including |trust|*. Write out program locations in full. * and ? work as wildcards for part of a name.
Example: trust all programs except those launched through an SSH login:
|trust|*
|path_no_trust|/usr/sbin/sshd
# all running programs
sudo takakrypt-fte status pslist
# explanation for a single program
sudo takakrypt-fte status pslist <pid>
# only programs that will be denied
sudo takakrypt-fte status pslist --denied
A typo in this file won't stop the agent. It keeps running with its previous trust settings and raises the HOSTSETTINGS-UNPARSEABLE alert. While that alert is up, the path_no_trust rules don't take effect, so fix the file right away.
That's the install done. Next up: the full tfe-config.yaml reference in Agent Configuration, or Upgrading and Uninstalling for what comes after.