I tried to restore Yunohost from backups on my Raspberry.
download latest version 🗸
flash the disk 🗸
boot 🗸
skip post-installation and restore backups ???
How I’m supposed to do? I think this was explained on the previous web site but I cannot find it again. I guess I need the default root password and then restore system backup ?
Bonjour,
J’ai essayé de restaurer Yunohost à partir des backups sur mon Raspberry.
télécharger la dernière image 🗸
flasher le disque 🗸
booter 🗸
sauter la post-installation pour restaurer les backups ???
Comment faire ? Je pense que j’avais lu ça sur l’ancien site mais je ne retrouve plus l’info. Je suppose que j’ai besoin du mot de passe de root pour pouvoir restaurer les sauvegardes ?
I did it with a log in as admin via SSH. To simplify matters, I connected to the old Yunohost and the new Yunohost via SSHFS. The old one is mounted at /home/wbk/sshfs, the new one is mounted at /home/wbk/sshfs2:
If your backup is on your laptop/workstation, and you can copy it directly, it would be :
$ scp /home/wbk/yunobackup/20210923-210543.* admin@yuno-IP:/home/yunohost.backup/archives/
$ ssh admin@yuno-IP
# enter password, you're in your Yunohost now
$ yunohost backup restore 20210923-210543
Thanks for your answer. It’s what I wanted to do. Anyway I’m on a headless machine, so I need to ssh. My problem is : when the post-install is not done, which account do I use for ssh? The admin account is not created, so I guess I have to use the root account. Is there a default password for it ?
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 ssh admin@yunohost-ip.
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:
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
Next time I start from a brand new image, I’ll check is root has ssh access without password before post-install. I was expecting some default password so I didn’t even tried.