The contents of this guide have been moved to our documentation website here.
This thread will remain open for discussion.
The contents of this guide have been moved to our documentation website here.
This thread will remain open for discussion.
yes, but we canât because the sd card is protected from writing
I already found the folder, I can save it, but I canât write. how can I do ?
I assume you are talking about the location to where you want to copy the files and not the card it self being write protected.
You need to give the PI user (thatâs the pre-setup system user you are logging in with) the access to write to the folder you want to copy the files to, or you can âsudo su rootâ and copy the files from a network source directly to the folder. Also be sure that the file and folder rights are the same before and after the copy, so system has the right access to read/write/execute the files.
Thanks.
Yes, it is what I try to do, but still donât know how to do.
Sudo su root, from autopi web terminal ?
Because ssh I canât
Im assuming you you have re-flashed your card and you have SSH access to the device?
Are you connecting to the AutoPi from Windows, Mac or Linux ?
For me is best with Mac
Yes, because I had reflashing it few days ago, I canât accès to ssh
I have pc windows too, so, I can try with but I donât know how
Ok, Im a Microsoft guy so cant help you with Mac âhow toâ since Mac is just a reskinned Linux in my Microsoft fan boy world but I can give you the steps I do when I re-flash my AutoPi. Do note that the way I do the Linux steps are not by any means the best Linux way to do it, im just a Microsfot guy so there is probably some better way to do the Linux commands and elevation of user access for the folders and pi user.
Before you re-flash the device, SSH in to AutoPi and manually backup the key files in /etc/salt/pki/minion
to the computer you are SSHâ Ăng from. In my case that is a Microsoft PC connected to the AutoPi Wifi hotspot and using Putty (https://www.putty.org/) to SSH to the AutoPi.
/etc/salt/pki/
and run the commands:This command will copy the minion folder to new folder (This is not needed if you will scrap/re-flash the same card and not take a full backup of the card), I do this step since I usually take a full backup of the card in case I want to restore it later (Here I use foldername_DateofCopy: minioncopy09022019, but you can use any folder name you want).
sudo cp minion minioncopy09022019
This command will give owner rights access to User âpiâ for the copied folder, this is required since WinSCP will use AutoPi user âpiâ to connect and we need the access rights to copy the folder content.
sudo chown pi minioncopy09022019
*Connect to your AutoPi with WinSCP and copy the content of the folder âminioncopy09022019â or the original âminionâ if you did not make a copy and just gave pi user access to the original folder.
Re-flash the AutoPi card with the above instructions in the Guide.
Add the card back in to your hardware and boot up the AutoPi.
Connect to the AutoPi Wifi hotspot (since the re-flashed AutoPi now has the core images User and Password, you need to connect with User:pi Password: autopi2018)
if you have connected with putty previously to the AutoPi then you will get a security warning about the host key windows has for the device (mac address) does not match the existing one:
Ignore the security warning as this will change again with the next steps (i.e select âyesâ).
Open WinSCP and connect to your AutoPi and copy the backup of the minion folder from you computer to AutoPi.
I copy my backup to the pi user location â/home/pi/â but you can add it to any location on the AutoPi you think makes sense.
Open a SSH session to AutoPi and change user to root:
âsudo su rootâ
/etc/salt/pki/minion
root@raspberrypi:/etc/salt/pki/minion# cd /home/pi/minioncopy09022019/
Copy the backup files to the minion folder:
root@raspberrypi:/home/pi/minioncopy09022019# cp minion_master.pub minion.pem minion.pub /etc/salt/pki/minion/
Thankâs you so much ! I will try tomorow.
I wknown_hostsill try to do step by step.
But the first problem I have is that:
I know I should delete the âknown_hostsâ but I donât know how
Then, when i solve this ssh problem, I can fellow your tuto.
And where are you getting that error? On the AutoPi when trying to SSH in to it?
If you have the AutoPi connected to a screen through HDMI cable, just add a keyboard to it and log on locally on the AutoPi using the pi user and fix the SSH access rights or approved hosts access.
Br,
Mikael
Hello.
I am too bad because I canât do it
I connect with WinSCP (ok)
I am connect as : pi (ok)
I use putty from scp and login as : pi
I write: cp /etc/salt/pki
Then I am in the folder
I write: sudo cp minion minioncopy
Then i have this: sudo: unable to resolve host autopi-ddfd00ac3465
So I try to login a root
I write: sudo su root
Then try again login as root:
Same problem
Hi Remy
You can just ignore the âunable to resolve hostâ, it is a minor bug in our code, and will be fixed soon.
The last error in your screenshot is that you need to use the argument â-râ when copying the minion directory, this is needed when copying directories.
So instead try with the -r argument like so.
cp -r minion minioncopy
You only need to use sudo in the command, if you have not already executed âsudo -sâ.
If the line in your terminal starts with âroot@â like in your screenshot, then you are already running with the root privileges.
Best regards
/Malte
thanks
i succed âŚ
Yeap sorry, missed the -r argument while I was writing up the steps.
No problem
I am ready to flash again
I just want to found before the known_hosts folder.
I canât find on WinSCP
I need delete/edit ? the line where i usually connect from my Mac
If you have no issue with SSH in to you device then ignore the error and continue.
I just want to log again with my Mac ;).
I just got a bit lost when it comes to: âRemember to update your device from the cloudâ - how is that done, I didnât intuitively or by a search find how this is done.
I am having some trouble, after reflashing the unit. Internet connection just seems to work with WiFi and not via the SIM card, Iâve tried two different SIM from two different companies. After that, in the auto pi cloud, it keeps saying that my unit needs some software upgrades but does not seem to install them, even when the device is connected via WiFi, is there any way to install the upgrades via SSH in some way?
Thanks