RSA keys and new computers

1

I just got a new computer. I have a keypair on my old computer, that I use to sftp into a server that hosts my website. I transferred my RSA key over to my new computer, but I still can't logon. Do I need the server administrator to accept a new RSA public key from this computer to be able to logon? He is on vacation...

Or is there some what I can get on using this different computer?

generic_user

Posted 2015-09-02T13:56:00.997

Reputation: 111

Answers

1

The RSA key pair (actually, the secret key) is not tied to the specific computer. (It may be tied to the IP address you are connecting from, but this is reasonably rare in common setups.) So you shouldn't need to do anything specific simply because you got a new computer.

However, you may want to take this opportunity to generate a new key pair. Good key hygiene involves regularly replacing cryptographic keys, particularly long-term/high-value keys such as SSH authentication key pairs. Depending on how your SSH environment is set up, you may need to coordinate this with the system administrator. I personally like to replace long-term keys every one to two years unless simply the act of replacing the key causes significant inconvenience.

It seems highly likely that your SSH (or SFTP, or SCP; they are all the same as far as this is concerned) client is not using the key pair to attempt authentication. For that reason, public key authentication would be unavailable, and if the server is configured to only accept public key authentication then this will cause authentication to fail, further leading to the connection attempt failing.

Transferring the key pair from one system to another is generally a two-step process:

  1. Copy the relevant files, making sure that you copy both the public and private key
  2. Point the SSH client on the new system to the private key file on the new system

While the exact steps will obviously vary depending on your client software, look for settings relating to authentication, key selection, and similar. Point the client software to the key file you copied from your old system, and attempt to connect. If you have configured your client correctly, it should use the key pair to authenticate, which will allow you to log in.

Look at any connection settings dialogs or similar to determine what any differences may be. Ideally, they should look identical (except for possible differences relating to different software versions).

a CVn

Posted 2015-09-02T13:56:00.997

Reputation: 26 553

0

It's a good idea to use different keys on different computers in order to limit the damage if one of the computers gets compromised, but keys aren't actually tied to computers in any way. If you copy your keypair (both id_rsa and id_rsa.pub) over to your new computer, and put it in ~/.ssh with the correct permissions just like on the old computer, it should work. You don't have to do anything special with the remote machine because it already has that key in its authorized_keys file.

Wyzard

Posted 2015-09-02T13:56:00.997

Reputation: 5 832