Macのターミナルから実行
ssh-copy-id root@ip-address
Sample
ssh-copy-id root@192.168.0.23
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/ichitaso/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
(root@192.168.0.23) Password for root@iPad7:(alpine)
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'root@192.168.0.23'"
and check to make sure that only the key(s) you wanted were added.
theosでの make package install や ssh root@ip-address でパスワードが不要になる
ssh known_hosts 変更/更新
同じIPへ違うデバイスで接続したときに発生するエラー
ssh root@192.168.0.21
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ED25519 key sent by the remote host is
SHA256:3v01gMZEcXSRo/4KV6fQZAhADgO/aNIylV1AeNS5hH4.
Please contact your system administrator.
Add correct host key in /Users/ichitaso/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /Users/ichitaso/.ssh/known_hosts:30
Host key for 192.168.0.21 has changed and you have requested strict checking.
Host key verification failed.
修正方法
ssh-keygen -R IPアドレス
Sample
% ssh-keygen -R 192.168.0.21
# Host 192.168.0.21 found: line 30
/Users/ichitaso/.ssh/known_hosts updated.
Original contents retained as /Users/ichitaso/.ssh/known_hosts.old
known_hosts.oldというファイルにバックアップもされる
該当行を削除してもOK