A
A
Andrey2019-03-23 20:47:22
SSH
Andrey, 2019-03-23 20:47:22

How to copy ssh key to another computer?

Problem following - on the server in ssh access for root is closed. The computer from which I accessed the server is now with a different OS, but the .ssh folder remains. Simply copying the folder to the current computer and setting 600 rights to id_rsa did not help, it still asks for a password. How else can you try to log in using the old key?
UPD. As a result, the hoster removed the access ban for root and was able to log in.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Shitskov, 2019-03-23
@Zarom

ssh -i путь-до-приватного-ключа [email protected]

V
Vitsliputsli, 2019-03-24
@Vitsliputsli

Regenerate the key pair on the client and copy the public key to the server in any convenient way.
It will not work differently, because. you yourself wrote that the keys on the client are destroyed. And do not copy directories and in particular private keys.

Z
zersh, 2019-03-24
@zersh

Also, check the permissions on the folder - they should be 700.
If it doesn't help: check /etc/ssh/sshd_config - whether authorization by key is allowed there at all.
If so, then only logs can help determine the cause

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question