I have a server that I log in with SSH and I use key based authentication. I now set up a second server and I want to use the same key for login.
Thus, I copied the file ~/.ssh/authorized_key from the old server to the new server.
On the Windows client, I cloned the SSH configuration in Putty and only exchanged the IP address of the server.
This does not seem to be sufficient. The error message of Putty on Windows is
PuTTY Fatal Error
Disconnected: No supported authentication methods available (server sent: publickey)
And on the SSH console I see
Server refused our key
The server configuration is
AllowGroups sshlogin
Port 2233
PermitRootLogin no
PasswordAuthentication no
ChallengeResponseAuthentication no
Even if I copy the other key files (id_rsa and id_rsa.pub), I still can't login.
# ls -l
total 12
-rw------- 1 root root 411 Jan 14 22:39 authorized_keys
-rw------- 1 root root 1792 Jan 14 22:53 id_rsa
-rw------- 1 root root 411 Jan 14 22:39 id_rsa.pub
Which files do I need to copy to get an identical SSH login on both machines?
I have tried:
- Can't make a 2nd ssh key login, but it's about 2 different keys on 1 server. I need 1 identical key on 2 servers.
ssh-copy-id, it copies your public key (rsa.pub) to the server (~/.ssh/authorized_keys) and sets proper permissions. – Panther Jan 14 '18 at 23:44rsa.pub, then usessh-copy-idand then deletersa.pub? I don't think the tool can copy something to the server, because the source is my KeePass file on Windows, wheressh-copy-iddoes not have access to. – Thomas Weller Jan 15 '18 at 09:16ssh-copy-id user@serverand everything is taken care of for you. You can keep or delete the rsa.pub on the client, but I usually keep it. You need the rsa to log in with. – Panther Jan 15 '18 at 10:27