Keep the shell configuration and the key out of the user's reach

The user could empty the authorized_keys and break the login of the
website, change the shell configuration to break the prompt, and write
startup files that zsh reads on every login. The shell configuration and
the key are now read-only for the user, and the shell reads its
configuration from ~/.zsh, so the files in the home directory are
ignored.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zebreus 2026-10-25 15:26:01 +01:00
commit 49c61b6b91

View file

@ -19,7 +19,7 @@ We only keep the basic user journey working.
Anything that breaks the following user journey is not acceptable:
- The user can connect with the SSH key as `root`.
- The prompt: `root@khaos-im-kiez:~#`, which `~/.zshrc` sets.
- The prompt: `root@khaos-im-kiez:~#`, which `~/.zsh/.zshrc` sets.
- The home directory the user ends up in: `/home/root`. They cannot change where it is, and they cannot delete it.
- `cat README`, `cat README.en`, `cat CODE_OF_CONDUCT` and `cat CODE_OF_CONDUCT.en` always work. The four files
are always there and always regular text files.
@ -41,6 +41,10 @@ The scheduled task `KiK restore shell files` runs every 30 minutes and at every
The second job should also be able to restore a new server to the expected state.
The files that have to stay belong to the administrators, so the user cannot delete them, and they cannot change the
shell configuration or the key the website logs in with either. The shell reads its configuration from `~/.zsh`, so
the startup files the user could write in the home directory are ignored.
## Installing the cleanup on the server
To deploy the cleanup task an the server, run: