Hermes Agent Advanced Guide: 3 Essential Steps for Server Security

Many people use Hermes Agent, but not many pay attention to security issues during usage. Your chat logs, personal information, and even some passwords and keys are always at risk of exposure if you don’t do some basic checks and configurations.

This article will teach you in two parts how to turn your Hermes Agent into an airtight safe house, so you can use it with peace of mind.

Part One: Server Security. Whether your Agent runs locally or on a remote server, you need to do some basic protection to ensure your data’s safety.

Part Two: Data Backup. Disasters are unpredictable—even if your server is remote, accidents can lead to your data becoming unusable. You must back up your important information so you can always recover if something goes wrong.

Server Security Settings

The scariest thing when using the Agent isn’t knowing your machine or server has issues, but not realizing you have a problem. That’s why it’s crucial to take precautionary steps. Below, I’ll use a Linux server as an example to show you how to harden your server’s security.

No need to worry if you don’t understand complex commands—just give the prompts below to an AI to operate. But you must carefully read the following precautions before starting.

The public internet is extremely hostile. Default port 22 and password login are prime targets for hacker scripts. To ensure your server doesn’t become a botnet zombie, you must do the following three configurations:

  1. Change the SSH default port: Change the default port 22 to a high port between 20000–65535. This will avoid 99% of indiscriminate automated scans.

    Check your current Linux system and SSH config, back up the config file, then pick an unused port between 20000–65535 and update your SSH setup. Allow the new port through the firewall and keep 22 temporarily. Reload SSH service and confirm the new port is listening. Give the login test command for the new port and rollback method; if there’s an error, stop immediately.

  2. Disable password login: Configure SSH key pairs to allow only clients with a private key to log in, and completely disable password authentication. This is much safer because leaked passwords are a huge risk; key-based login pretty much eliminates brute-force and other types of scanning.

    Check your user’s SSH public key and authorized_keys file permissions. If you don’t have a key, have the AI guide you to generate an Ed25519 key locally—you only provide the public key, never the private key. Back up your SSH config and enable key authentication. After confirming you can log in with the key via another terminal, then disable password and interactive authentication. Check, reload, and verify the service, and provide result and rollback steps.

  3. Set up Firewall and Fail2Ban: Enable the UFW firewall and allow the new SSH port; enable Fail2Ban to monitor SSH logs and automatically ban malicious IPs that fail multiple tries.

    Check your server’s existing firewall, SSH port, and active business ports. Back up existing rules, open the new SSH port and needed business ports, enable UFW with default deny inbound, allow outbound. Then install and configure Fail2Ban to protect the new SSH port with maxretry=5, findtime=10m, and bantime=1h, and check that the firewall, Fail2Ban, and SSH are all working. Don’t overwrite existing rules. Finally, provide config results and rollback instructions.

Do not close your current SSH window while configuring. Use another terminal to confirm new port and key login work. For cloud servers, open the new port in the security group. Don’t shut down port 22 or password login before confirming the new login method works, and never send your private key to any AI. It’s best to take a server snapshot or confirm you can use your cloud provider’s console rescue mode before making changes.
If you want to set things up yourself, check my article: From Zero to One: My VPS Standard Initial Setup SOP—Five Steps to a Stable, Secure, High-Performance Server

Data Backup

There are many ways to back up data, but I think the safest and most efficient is using a GitHub repository. It has these advantages:

  1. You only need a simple email to register and it offers account and API Key authorization. Managing repos and content is very convenient—especially with the official gh tool, which has a full interface for AI automation.

  2. Using GitHub is basically a must-have skill for any AI system—there are many excellent open-source tools and projects, whether for learning or finding software to use.

gh installation command: sudo apt install gh

Account Login

GitHub provides two login methods. One is with your username and password. The other is to create an API Key—each has pros and cons.

The first method is simpler—just provide your username and password, but the permissions might be too broad which can impact or pollute your projects. If you only have one project, that’s fine, but if you have multiple accounts, it’s not recommended.

Login command: gh auth login, then select GitHub and use HTTPS browser authorization. You’ll get a URL and code—just enter the code into your logged-in GitHub account.

The second method is a bit more complex: you need to apply for the corresponding API Key in your account settings and can set permissions and project scope so the key only does what you want and nothing else.

  1. Log into GitHub and select Settings

  1. Select Developer settings

  1. Create API Key (Personal access tokens → Fine-grained tokens)

Here you can control permissions and expiration. If you aren’t sure, use the first method by default. If you’re interested, I can create a dedicated article about managing GitHub repo permissions.

Once you have your API Key, the login is the same—just choose Auth Token login and enter the API Key.

Automated Backup

Once you’re ready, you only need one command to let your Hermes Agent do automated scheduled backups.

However, before doing this, sort out which folders actually need to be backed up and which don’t. Uploading everything would be inefficient and GitHub repos have storage limits, so you must make a distinction.

What Needs to Be Backed Up

In short: Assets you maintain manually, unique and irreplaceable content. I’ve listed them for you here:

SOUL.md – AI character attributes
config.yaml – Basic configuration
skills/ – Your own skill library
scripts/ – Custom scripts
wiki/ – Opinion library (not everyone will have this)
cron/jobs.json (task definitions) – Automation tasks

Each listed item is unique and will differ between everyone’s Hermes Agent. If one is lost, there’s essentially no way to recover except by recreating your previous content from scratch, so backup is a must.

What Doesn’t Need to Be Backed Up

In short: Don’t back up runtime-generated files. These may be system files or temporary files created during operation. Deleting them won’t affect overall usage too much.

.env – Environment config containing secrets (don’t back up for security)
auth.json – Authorization info
sessions/ – Chat logs and info (back up if you want history)
logs/ – Operation logs
cache/ – Cached content
executions.db / ticker / lock
node / lsp / dependencies

Setting Up Automated Backup Tasks

After sorting, backing up is easy—just tell your Hermes Agent to set up a daily scheduled task at 3am.

You can use my suggested prompt below for the AI:

Make a lightweight configuration backup of Hermes every day, keeping only reconstructible data and not backing up runtime junk or sensitive credentials.

Scope of the backup:
1. SOUL.md and config.yaml for the main profile
2. SOUL.md and config.yaml for research/publish/shortvideo-pipeline (if they exist)
3. ~/.hermes/skills/
4. ~/.hermes/scripts/
5. /root/hermes-wiki
6. ~/.hermes/vault/opinions/ (if present)
7. cron/jobs.json for each profile (if present)

Don’t back up:
- .env
- auth.json
- sessions/
- state.db
- logs/
- cache/
- executions.db
- ticker/lock files
- node/lsp artifacts

Requirements:
- Target repo: /root/hermes-backup
- Use sync mode to overwrite old data, delete target files if missing in source
- git add -A
- Commit and push only if there are changes
- Commit message: auto backup YYYY-MM-DD_HH:MM
- On failure, output clear error message, do not suppress errors silently

After setting up, be sure to check your GitHub repo the next day to confirm if the backup succeeded. That’s why I included the instruction to output clear errors instead of swallowing them.

I once thought my backup was always successful only to find it had failed silently, so I don’t want others to repeat my mistake.

Final Words

With basic security and scheduled backups, you can use your Hermes Agent with confidence, with little risk of info leaks or data loss.

Only those who have lost data or had their server compromised understand the importance of these two points. Don’t wait until there’s a problem to start looking for remedies—always be prepared!

I hope you learned something useful. If you want to learn more about Hermes Agent, check out my tutorials:

5 Likes

Thank you so much for the tutorial.

PS: I have a suggestion for your website. I noticed you have two links at the bottom—one with “www” and one without. Both pages open normally without any redirection. This splits your site ranking authority, so it’s best to set up a 301 redirect from one domain to the other.

Thanks, I’ll take care of it right away.

Thank you for sharing the tutorial.

Thanks for sharing

Thanks for sharing

Thanks for the reminder!

Great, I just needed this. Thanks for sharing :xhj008:

Thank you

I’ve learned something new.

Thanks a lot for sharing!