# SSH login with public key

## petrjanda

Tell me what Im not getting about SSH login using public key. This is the situation: An organization has sent me their public key, username and IP address and says to use this to connect to their SSH server.

I've always been under the impression that when I receive a public key from someone, it is to allow THEM to remotely login to my server without a password by adding that key to .ssh/authorized_keys, not the other way around that the Organization is proposing.

What am I not getting?

----------

## dattaway3

put the key into your .ssh/id_rsa

ssh <ip_address>

and you are logged in

that's it!

----------

## petrjanda

 *dattaway3 wrote:*   

> put the key into your .ssh/id_rsa
> 
> ssh <ip_address>
> 
> and you are logged in
> ...

 

I've done that, its still asking me for password.

----------

## Hu

 *petrjanda wrote:*   

> Tell me what Im not getting about SSH login using public key. This is the situation: An organization has sent me their public key, username and IP address and says to use this to connect to their SSH server.
> 
> I've always been under the impression that when I receive a public key from someone, it is to allow THEM to remotely login to my server without a password by adding that key to .ssh/authorized_keys, not the other way around that the Organization is proposing.

 Right.

 *petrjanda wrote:*   

> What am I not getting?

 Access to their network.  You must send them your public key and have them place it on their server to let you in.

 *dattaway3 wrote:*   

> put the key into your .ssh/id_rsa
> 
> ssh <ip_address>
> 
> and you are logged in
> ...

 They sent him a public key.  Assuming they called it correctly, it would go in authorized_keys and allow them to connect to him.

----------

## phajdan.jr

 *petrjanda wrote:*   

> Tell me what Im not getting about SSH login using public key. This is the situation: An organization has sent me their public key, username and IP address and says to use this to connect to their SSH server.

 

Something seems wrong here. I think you should give them your public key and they should add it to their authorized keys.

Note that another option that could be considered here is that they give you a private key to use with their server. This is wrong however, as now there is more than one person that knows your private key.

 *petrjanda wrote:*   

> I've always been under the impression that when I receive a public key from someone, it is to allow THEM to remotely login to my server without a password by adding that key to .ssh/authorized_keys, not the other way around that the Organization is proposing.

 

Your concern makes sense. Either there is some misunderstanding there (unlikely), or they are really doing it wrong.

----------

