Answer the question
In order to leave comments, you need to log in
How to use SSH authorization keys correctly?
In all manuals for using keys, they give an example with a standardly generated name "id_rsa". Login is working fine.
But when I create, for example, 5 keys for 5 different machines, copy them there via ssh-copy-id, naturally the key names differ from the standard "id_rsa", then autologin no longer occurs, since ssh looks for the same key by default:
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: ~/.ssh/id_rsa
debug1: Trying private key: ~/.ssh/id_dsa
debug1: Next authentication method: password
Answer the question
In order to leave comments, you need to log in
man ssh_config
Create ~/.ssh/config and fill in the host and IdentityFile matches. Here you can specify the port, username and other joys.
You can use the same key for all machines. Further than the local machine, the private part of the key does not get anywhere, and if an attacker can steal it, then with the same result he will steal all five keys)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question