I need to connect to hostB using user2 from hostA where I´m connected using user1.
I've run ssh-keygen for user1 on hostA and copied the public key generated in id_rsa.pub to the authorized_keys of user2 in hostB.
Then I tried to connect from hostA to hostB using the command:
$user1@hostA> ssh user2@hostB
I still get a request for password:
If I try to connect using the same user on both hosts, it works correctly:
$user1@hostA> ssh user1@hostB Enter passphrase for key '/home/user1/.ssh/id_rsa':
What am I missing?