Reset sshd host key mode on every start #1
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-sshd-host-key-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In self-service the test API pod is in CrashLoopBackOff (503).
sshdexits withPermissions 0660 for '/data/ssh_host_ed25519_key' are too open.The key is created with
umask 077(0600), but the deployment hasfsGroup: 10001, so kubelet makes the files on the PVC group-writable at every mount. The first start works; any restart fails.supervise()stops all children when one exits, so the API goes down withsshd.Fix
host_key.chmod(0o600)before startingsshd. The file belongs toapp, so the chmod works underfsGroup.Tests
test_main_restores_private_host_key_modefails without the fix;tests/test_selfservice.pypasses (10 passed).