Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
9
Help us understand the problem. What is going on with this article?
@hayate242

RaspberrypiでSSHができなくて試したこと

More than 1 year has passed since last update.

久しぶりにラズパイいじって見よーと思ったらSSHができなくてビビりました.

で,基本的にはここを見てやりました.
https://qiita.com/Halhira/items/1da2ae543217be26988a

SSHがなぜかうまくいかなくて

$ ssh pi@raspberrypi.local
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:tkeCkp3+1TuManZJaXXeS3IiFq0ySSTElcKlUslay9g.
Please contact your system administrator.
Add correct host key in /Users/hayate/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/hayate/.ssh/known_hosts:18
ECDSA host key for raspberrypi.local has changed and you have requested strict checking.
Host key verification failed.

こんなわけのわからないものがぁ
どうやらSSHのホストキーが変わることが原因らしい.
SSHで接続するときにホストキーを再生成していたり、同じIPアドレスやホスト名だけど違うサーバに接続したり、再インストール後に接続したり、とにかくそういったときに表示されるメッセージだそうです.

いろいろ調べた結果前に接続したことがあるラズパイが原因みたい
ssh-keygenの-Rオプションでraspberrypi.localに属してるキーを全部削除して
$ ssh-keygen -R raspberrypi.local
接続し直すとうまくいきました.
$ ssh pi@raspberrypi.local
raspberrypi.localの部分はホスト名です

9
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
9
Help us understand the problem. What is going on with this article?