I realize you got a ready-to-go image for Raspberry, is that correct? I have no experience with that image. In my case it was always Debian/Armbian + Yunohost, so the server was already installed when I needed to restore an image.
I think admin is already available before post install, but without a password. I imagine adding your SSH key to Yunohost should do the trick:
- Check if you got, on your regular computer, an SSH-keypair:
$ ls ~/.ssh/id_rsa*
- There should be a private key (id_rsa) and a public key (id_rsa.pub). Give the public key to everyone. Never share your private key!
- No keyfile? Generate it with
$ ssh-keygen and follow the steps. It is generally considered safe (and convenient) to generate a key without passphrase.
- connect your storage from the Raspberry (uSD card or USB drive) to your regular computer
- Check to see if there is an authorized-keys-file,
$ cat /media/'yunostorage'/home/admin/.ssh/authorized_keys.
- I think there is no file yet. In that case, copy your ~/.ssh/id_rsa.pub to the Yunohost storage and rename it to authorized_keys, in admin’s home directory:
cp ~/.ssh/id_rsa.pub /media/'yunostorage'/home/admin/.ssh/authorized_keys
- Sync/safely disconnect the Yunostorage, and reconnect it to your Raspberry.
- Now you should be able to log in to yunohost from your computer, as your regular user account with
All of this is on your laptop/workstation, not on your Yunohost. It seems a bit convoluted, but once you got your key in the authorized_keys file on your Yunohost, logging in is more convenient.
The authorized_keys file, by the way, looks something like this:
$ cat /home/admin/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDU7Q16k3lUNPz9SsgyS/ENTinYyV0zDXL+raRzBBoYgwFq+9XpK+ZZ/wId8j+xUhvhATU7rN0tcEh16QZvRhui1NEClDMTY2dSC67e+j0Ll4dC9WOkdQl5kGhyFuOGxnaNqSnahOAYgq8fBb2brLkjoEqRYrjSl2EuAhQvqe46gKB2qBc/VNTHvJSIhm3W7R7k/xO8VH6mQkbHnW/vusBtFTU4R1wcuDm46k3sCdR856Fw/czt089zvuQDKgHHXUR5R58aEEUCTQ78M0sFajyYR0X1VUzP35y9p+qtA8Esi9QktidrD5KdHFwbqbNq73pCUpdAdAbaM5HBPKVpv8Fz wbk@tp
So, it starts with the encryption scheme (ssh-rsa → rsa), then lists the public key (the letters and numbers), and finally the remote username @ remote computer (wbk@tp).
Don’t use my example in your Yunohost: then I can log in to your system