Guide: How to SSH to your device

The contents of this guide have been moved to our documentation website here.

This thread will remain open for discussion.

1 Like

@Malte
What should I do ? I have this error
24

Hi Remy

This is because you have probably connected to another raspberry pi before.
It gives you that error because the hostname of the raspberry pi has not changed, but the underlying keys has.

So you need to remove the key in the known_hosts file, where the raspberry hostname is :slight_smile:

Best regards
/Malte

Hello.

Yes, but i had same autopi. It is because I had reflashing it, i should remove knows_host file, it is true.

But i can’t connect to ssh so i can’t :frowning:

I try also from autopi web accès, but without succès.

Today I try from pc windows, and mount image autopi as Linux compatible with succès. I can found the folder but still can’t write because write protection.

So to remove writing protection of the sd card I should do something but I don’t know what.

So my idea is remove writing protection of the sd card

Make a copie of the token ( if I want reflash it without re register it )

Delete the know_host file.

I still need help

If all ok, i will reflashing the autopi with the before last firmaware properly. With ssh working. Because last firmware don’t work for me. Odb not show nothing :frowning:

Hi Remy, I will take a look at this tomorrow.

You don’t have to delete the entire known_hosts, just open in at remove the line that starts with “raspberry”.

Basically, the issue you are seeing is probably because you are not root when trying to copy the files from the SD card. It has nothing to do with the physical write protection switch on the card.
So as long as you run the command “sudo -s” before trying to access the files, then you should be golden.

Best regards
/Malte

1 Like

Hello
Thanks you but I still not succed.
You say I should write sudo -s
But when ?
As login in ssh with pi user ?
Not work
Or login a root user on ssh ?
I try it but still the password miss.
It is not same as pi ?
I try to copy or edit file with scp, login as pi is ok
Login as pi is ok with putty ssh
So, after i don’t know how to change write accès
image
And wich ssh is ? I have a lots image

hi, where is the folder of known_hosts file ?
I can’t find it
thanks

If you need root privileges you can change to ‘root’ by using

sudo su root

And the password asked is pi users password when you call ‘sudo su root’

https://kb.iweb.com/hc/en-us/articles/230241728-Using-the-su-command-and-switching-from-user-to-root?mobile_site=true

Just be sure to understand that when you change/elevate your session to use root account, the access of root will allow you to do anything. even delete stuff you should not delete so be very selectiv with what you use root for and when.

Br,
Mikael

1 Like

FYI: Instead of editing the file directly, you can do the following.

ssh-keygen -R local.autopi.io

-R Remove all keys belonging to a hostname from a known_hosts file.

1 Like

ありがとうございます😊(^。^)
Thank’s !

1 Like

First picture: from my pc.
Try to do it.

Then, from Mac , the error still stay.
So not working.
Any idea ?
image image

Well looking at your Mac CMD prompt, the issue is your existing host key stored on your MAC not your AutoPi. The MAC settings for the host key validation is set to strict so the MAC will block the connect to the AutoPi until you either lover the validation level or you remove the old host key from the MAC repository.
Im not a MAC user so I cant say if the same command ‘ssh-keygen -R local.autopi.io’ for RPI will work for MAC, but if this was Windows I wold just remove the SSH key for the host (AutoPi).

1 Like

Maybe you need to use uppercase “-R” as argument.

Or alternatively as @Mikael suggests, just edit the file.
You need to remove the line that starts with “local.autopi.io”
The file should be located here

~/.ssh/known_hosts

Best regards
/Malte

1 Like

ha, ok… I make mistake again sorry ! :no_mouth:
this is work on Mac too, but still I had put the ip of the Mac, but we should put the ip of the autopi, so I my case 192.168.4.1
ssh-keygen -R 192.168.4.1 working well on Mac
but
ssh-keygen -R local.autopi.io don’t work, but it is ok.

so, all is ok now, I stop to bother you :rofl:
maybe if a novice like me read all my boring post, it can help him, lol :grimacing:

I really wanted to understand autopi well, so now a little more, so thanks you
i had copy the file from autopi to my pc and resolve this too.
also I can flash again my autopi in perfect condition :sunglasses:

1 Like

Yes no problem we are all here to learn and share :slight_smile:
Though I would suggest that you sanitize your posted information of anything security sensitive, for example posting key fingerprint here in your comment and other things that are specific to sensitive information :wink:

2 Likes

Ha yes it is true I forget it… :sweat_smile:
I make update a the post to hide it
Thank’s :slight_smile:

Hi,

I believe that raw data is saved into the Autopi before pushing it into the cloud:

  1. How long is it there until it is deleted?
  2. Is it possible to retrieve it through ssh?
  3. What is the path to the data or the folder structure?
  4. Is this raw data readable? json, csv…

Many thanks in advance,

Iker

3 Likes

Interesting question, we are facing a similar issue. Would be great to hear some update on how the raw data could be read directly from the device.

1 Like

Hello,

I’ve setup my autopi to connect to my home wifi in local.autopi.io then I’ve tried to ssh into it using the IP I got from my router. It wont allow me. Is there a setting that I can set to have the pi listen to port 22 on that IP?

Regards,
Mark