Just trying to connect to another computer on my lan .
I install openssh on both computers.
Here is the message I am getting:
[demo@Manjaro ~]$ ssh -p 2222 demo@192.168.68.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:aNdqE2oU1CKKcyUFiujnVitegfPGowh+pkwDmTIVHpo.
Please contact your system administrator.
Add correct host key in /home/demo/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/demo/.ssh/known_hosts:30
Host key for [192.168.68.21]:2222 has changed and you have requested strict checking.
Host key verification failed.
This is the clue. I’ve had this happening to my computers too in the past, and deleting the file — in my case, there was only one entry in it anyway — solved it. The file was recreated on the next ssh login.
That got me in now I want to set it up so I don’t have to use a password just have it exchange keys to connect.
I know I have to create a public key and sent to the machine.
emo@Manjaro .ssh]$ sudo ssh-copy-id -p 2222 demo@192.168.68.21
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
/usr/bin/ssh-copy-id: ERROR: No identities found
Here is how I just now set up passwwordless into my server:
[tracy@daphne .ssh]$ ssh-keygen -t ed25519 -C "your_email@domain.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/tracy/.ssh/id_ed25519):
Enter passphrase for "/home/tracy/.ssh/id_ed25519" (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/tracy/.ssh/id_ed25519
Your public key has been saved in /home/tracy/.ssh/id_ed25519.pub
The key fingerprint is:
+----[SHA256]-----+
[tracy@daphne .ssh]$ ls
id_ed25519 id_ed25519.pub known_hosts known_hosts.old
[tracy@daphne .ssh]$ ssh-copy-id super@annie
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/tracy/.ssh/id_ed25519.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
super@annie's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'super@annie'"
and check to make sure that only the key(s) you wanted were added.
[tracy@daphne .ssh]$ ssh super@annie
[super@annie ~]$
[demo@Manjaro .ssh]$ ssh-copy-id -p 2222 demo@192.168.68.21
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ssh-add -L
/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: 2 key(s) remain to be installed -- if you are prompted now it is to install the new keys
demo@192.168.68.21's password:
sh: line 1: .ssh/authorized_keys: Permission denied
log in and check your user’s .ssh directory, you can delete the authorised_keys file there, and do the same in your client and start again. You can safely clear the .ssh directory,especially if it has only the server data in there, the data can be regenerated.
When I went to edit the authorized_keys file it told me it was unwriteable.
Turned out it was owned by root.
chown to the user and like magic it worked.
I don’t know how it was root but it was.
Thanks for helping again.
It is late I am going to bed.
Goodnight and thanks again.