5 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
351b6a5c9b
ssh: Read/write authorized keys file using user account privileges
Fixes: #2588.

Otherwise, unprivileged user accounts can read/write files that they were not
permitted to by setting the authorized_keys file to be a symlink.

Tests:

- Editing page for freshly created user (as root or as user) shows empty value
  for authorized_keys.
- Setting SSH key for freshly created user works (as root or as user). File is
  created. Permissions are 0o644 and ownership is the user:'users'. .ssh
  directory is created with user:'users' ownership. Login works after setting
  the keys.
- After setting authorized keys they are shown properly in the user edit page.
- Editing again works.
- Clearing the values work.
- Linking authorized_key to another file owned (with proper permissions,
  ownership) by the user works. Values are shown properly in the edit page.
  Setting values works. SSH Login works.
- Linking the authorized_keys file to /etc/shadow leads to returning empty
  string.
- Linking the authorized_keys file to /etc/shadow, writing keys fails. Error
  message is shown 'Unable to set SSH keys.'. Exception is shown in logs.
- Linking .ssh directory to /etc, writing keys fails. Error message is shown
  'Unable to set SSH keys.'. Exception is shown in logs.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-11-02 11:36:55 -05:00
Sunil Mohan Adapa
0120ea0e55
ssh: Use pathlib during SSH key operations
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-11-02 11:36:54 -05:00
Sunil Mohan Adapa
5e17a84c8a
*: Update import path in modules-enabled configuration files
from plinth.* to freedombox.*

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-08-28 07:35:53 -04:00
Sunil Mohan Adapa
baa44e91a2
*: Update imports statements from plinth to freedombox
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-08-28 07:35:18 -04:00
Sunil Mohan Adapa
23b6aff290
plinth/*: Rename plinth/ folder to freedombox/
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-08-28 07:35:01 -04:00