IMO it is best to use ssh-copy-id <host> to transfer your public key.
I have begun using: ssh-keygen -f "/home/<my-uname>/.ssh/known_hosts" -R
"<remote-host-fqdn>"
to remove ID's from my local .ssh/known_hosts file.

The advantage of the first is that you don't accidentally copy your private
key.
The advantage of the second is that you don't accidentally remove a key
that you didn't want gone.

On Wed, Apr 19, 2023 at 2:39 PM Rich Shepard <rshep...@appl-ecosys.com>
wrote:

> On Wed, 19 Apr 2023, Russell Senior wrote:
>
> > Your client is complaining about the new host key. You need to remove the
> > old hostkey from your *CLIENT'S* known_hosts file. The message is telling
> > you what it doesn't like "Offending ED25519 key in
> > /home/rshepard/.ssh/known_hosts:2".
>
> Russell,
>
> That's what I learned reading more about openssh.
>
> > So, you can use an editor to remove the offending line 2, and you'll be
> > asked to accept the new hostkey the next time to connect.
>
> This answers the question I was about to ask: how to add a new host to
> caddis' know_hosts file. I didn't know it was done automatically when I
> connected to salmo.
>
> Thanks very much,
>
> Rich
>

Reply via email to