ssh key pair authentication - from 2 computer?

I have ssh key-pair authentication enabled on my linode. It will work from one computer.

When I generate a key-pair from a second computer and upload to the linode, the first computer is no longer able to login via its key-pair.

I have been unable to figure out how to login from two computers, a laptop and a desktop.

Is there a good way to set this up?

Thank you,

v/r

Jeff

5 Replies

What I call a brute force method worked.

I copied the .ssh folder and set the permissions from my desktop linux computer to my Macbook Pro. It works.

I'm not sure that is the best way to do things but it should still be secure.

Jeff

You should not copy your entire .ssh directory to a server. Private keys should always remain in your computer, not in the server.

Your .ssh/authorizedkeys file in the remote server should be the concatenation of all the public keys for which you want access to be allowed, one per line (there is even a command for doing that, it's "ssh-copy-id"). What you describe suggests that you were probably overwriting authorizedkeys with the new public key, instead of appending the new public key.

No. I didn't copy anything from .ssh to my server only to a second computer from which I would like to access the server using secure shell.

Thank you,

Jeff

You are probably overwriting the existing public key.

What you should do, is to use the ssh-copy-id command to transmit both keys to the server, or manually copy paste/append both public keys in the authorized_keys file of the server.

This is the proper method, so that each connected client uses a separate key. If one is compromised, then you can easily remove the compromised public key from your server, while keeping access from the still-secure client intact.

Thank you.

I will give that a try and post back with the results

v/r

Jeff

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct