teleport service as non-root #11485
-
Haven't been able to find anything in the docs or GitHub issues/discussions. But would it be possible to run the teleport service on a host without elevated privileges? So that I can login as a regular user not in |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
As mentioned here https://goteleport.com/docs/installation/#installing-from-source I need to make
|
Beta Was this translation helpful? Give feedback.
-
You can run the Teleport auth and proxy services as a non-root user without any trouble (as long as you grant read/write permissions on The one exception is that you can't run the Teleport node service ( |
Beta Was this translation helpful? Give feedback.
-
@webvictim Thank you. But with no privilege to set permissions on the |
Beta Was this translation helpful? Give feedback.
-
Hi, we were trying to achieve same thing where we would like to run Teleport as non-root user but we noticed that there was an error like even if we grant root permissions for /var/lib/teleport/proc folder where the SQLite DB writes: 2024-06-04T20:44:01Z ERRO [SQLITE] "Failing schema step: CREATE TABLE IF NOT EXISTS kv (\n key TEXT NOT NULL PRIMARY KEY,\n modified INTEGER NOT NULL,\n expires DATETIME,\n
value BLOB,\n revision TEXT NOT NULL DEFAULT \"\"\n\t\t);\n CREATE INDEX IF NOT EXISTS kv_expires ON kv (expires);, unable to open database file: permission denied." lite/lite.go:343
ERROR: initialization failed
error creating schema: file:/var/lib/teleport/proc/sqlite.db?_busy_timeout=10000&_sync=FULL&_txlock=immediate
unable to open database file: permission denied Here is list of my file/folder permissions within the container. bash-5.2$ ls -latr /var/lib/
total 24
drwxrwxrwx 3 nonroot nonroot 4096 Jan 1 1970 teleport
drwx------ 2 ftp ftp 4096 Jan 1 1970 ftp
drwxr-xr-x 3 root root 4096 Jan 1 1970 db
drwxr-xr-x 2 root root 4096 Jan 1 1970 apk
drwxr-xr-x 9 root root 4096 Jan 1 1970 ..
drwxr-xr-x 6 root root 4096 Jan 1 1970 .
bash-5.2$ ls -latr /var/lib/teleport/
total 12
drwxrwxrwx 2 root root 4096 Jan 1 1970 proc
drwxr-xr-x 6 root root 4096 Jan 1 1970 ..
drwxrwxrwx 3 nonroot nonroot 4096 Jan 1 1970 .
bash-5.2$ We were using the teleport-cluster Helm Chart to deploy Teleport, https://charts.releases.teleport.dev/, so, we just changed the name of the container image, that's all. |
Beta Was this translation helpful? Give feedback.
You can run the Teleport auth and proxy services as a non-root user without any trouble (as long as you grant read/write permissions on
/var/lib/teleport
to that user as you mentioned). Other Teleport agent services (like Kubernetes/Database/Application/Windows Desktop access) can also be run as a non-root user without any issues.The one exception is that you can't run the Teleport node service (
ssh_service
) as a non-root user because it may need to spawn a shell as any user logging into the node (which could beroot
). It may be possible to work around this with capabilities/setuid, but I haven't ever tried it.