ZimaOS - Creating authorized_keys and adding public SSH keys in Read-only system

Hi Community,

I’m trying to add public ssh keys into ~/.ssh/authorized_keys.
Getting errors like ‘Read-only’ etc when I try to create and try to save the file, how do you generate and add your public ssh keys on ZimaOS?

I generated keys in the /DATA folder, want to copy them into ~/.ssh/authorized_keys but am met with again ‘Read-only’.

With kind regards,

Hum+

1 Like

Update
You can override the given AuthorizedKeyFile to point to a diff ssh location and setup.
However so far the stored public keys aren’t found when I try to SSH from putty, IDE or terminal.

Still trying to get this integrated.

Update
Steps taken so far:

There are multiple people invested in this endeavour so far wanting to self-host using Casa/ZimaOS.
The risks that come with it are for the people that do that and/or have the proper insurance for it. This is not a problem IceWhale should identify as ‘their problem’.

I also wanna give out that I have been receiving very negative and criticizing (almost personal attack) responses because we are trying to get Coolify to work properly on ZimaOS and the ZimeCube Pro. I have reported this to the mods and I discourage any form of even thinking of breaking discord or forum rules.

1 Like
  1. Create a writable directory
    mkdir -p /etc/ssh/keys-root
    chmod 700 /etc/ssh/keys-root

  2. Edit sshd_config
    vim /etc/ssh/sshd_config

Add this line at the end of the file:
AuthorizedKeysFile /etc/ssh/keys-root/authorized_keys

  1. Create the authorized_keys file
    vim /etc/ssh/keys-root/authorized_keys

Paste your public key:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI… voce@seuPC

chmod 600 /etc/ssh/keys-root/authorized_keys

systemctl restart sshd

i would like if they could add an easy way of adding ones ssh key like with the “ssh-copy-id” tool or via webui.

reason for me is i would like to create an user that could rsync to a zimaos directory easily and from with ssh rsync with locally created ssh keys, so locally available ssh-copy-id tool or again could be via webui to remote host.

For anyone, who would like to actually make it work, at least on ZimaOS 1.7, here a quick step-by-step.

  1. On the client machine, generate the key pair: ssh-keygen -t ed25519
  2. Find the id_ed25519.pub file (on Linux it’s usually in ~/.ssh directory), and view its content: cat id_ed25519.pub. Copy the content for later.
  3. Connect with the ZimaOS using ssh: ssh your-zimaos-username@zimaos-ip-address
  4. Go to /etc/ssh and create a file authorized_keys. Paste the content of the id_25519.pub file into the authorized_keys file and save it.
  5. Open the sshd_config file: sudo nano /etc/ssh/sshd_config and set the following values:
    • AuthorizedKeysFile /etc/ssh/authorized_keys
    • PasswordAuthentication no
    • KbdInteractiveAuthentication no
    • UsePAM no
    • PermitRootLogin no (should be set to “no” by default)
    • PermitEmptyPasswords no (should also be set to “no” by default)
  6. Restart the SSH service: sudo systemctl restart sshd
  7. Reconnect to the ZimaOS with ssh. This time it should not require password.
  8. If anything goes wrong, you can still access the server via ssh by going to the ZimaOS WebUI > Settings > General > Developer mode > View > Web-based terminal