How do I reference a certificate file from cloudflared’s config.yml?

0
0
Asked By MellowCedar42 On

I'm running Debian 12 and configuring a cloudflared tunnel. My config.yml is stored outside my home directory, while the XYZ.json certificate file is somewhere under my home directory, such as /home/username/.cloudflare/. The tunnel service reports that the JSON file does not exist, so I suspect the path syntax is wrong. What is the correct way to reference a file located in another directory, and how do permissions or running the service as root affect the path?

1 Answer

Answered By BrightOtter7! On

Use the file’s absolute path rather than a relative path or a path beginning with ~. For example: /home/username/.cloudflare/XYZ.json. Add that path to the appropriate certificate or credentials-file setting in config.yml. Also make sure the account running cloudflared can traverse the directories and read the JSON file. If the service runs as root, it will still need the exact absolute path, and root’s home directory is /root—not your normal user’s home directory.

QuartzPanda19 -

The JSON file does not have to be beside config.yml. The important parts are using the correct full path and ensuring the cloudflared service user has permission to read it.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.