First, generate a new RSA key pair, like this: ssh-keygen -t rsa -f test_server
(the both files will appear in ~/.ssh folder).
Second, send your RSA key to the target server, ssh-copy-id -i test_server [email protected]
. A note. The name of the file must be pointed out prior the address.
The last step, you have to indicate to the ssh utility which key to use if you connect to the 1.1.1.1 server. Edit the config file in the ~/.ssh folder like this:
#test server
Host 1.1.1.1
HostName 1.1.1.1
User user
IdentityFile ~/.ssh/test_server