Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I send someone my SSH public key? [closed]

I need to send my SSH Public Key to one of my customers, but I am not quite sure how to do this. I have already created a SSH key pair on my computer, but now I am stuck.

like image 925
CJ Hill Avatar asked Apr 11 '15 22:04

CJ Hill


People also ask

Can I email a public key?

For users who wish to communicate sensitive information via email, public key cryptography can be used to send and receive email messages securely. In public key cryptography, a pair of cryptographic keys, one public and one private, are generated for each user.

How do I distribute an SSH key?

On the local host, use ssh-keygen -e to export the public key into a UNIX file. Use FTP to distribute the uniq-ssh. type file to the remote host. You have now completed distribution of the public keys to remote hosts that store user keys in a UNIX files .

Can you share ssh keys?

Conceivably, you can share the public key with anyone without compromising the private key; you store it on the remote system in a . ssh/authorized_keys directory. To use SSH public key authentication: The remote system must have a version of SSH installed.


Video Answer


2 Answers

If you generated a key pair you should have two files id_rsa and id_rsa.pub (note that id_rsa may be replaced by an other name if you specified it).

The public key (so the *.pub file) is the one which is meant to be shared so this is the one you should send to your customer.

However note that even though this file is public it is important that your customer receives the one you generated. If someone were to temper the file they could impersonate your server with the security issues this implies. So it is up to you to decide of a safe medium to share this file: This could be a physical USB key given from hand to hand, a secured messaging service or any other secured communication channel you have with your customer.

like image 70
statox Avatar answered Sep 20 '22 21:09

statox


This is way late but could be easier then just sending hidden files if you are on a unix based system.

Just do:

pbcopy < ~/.ssh/id_rsa.pub 

This will copy your public key to your clipboard. So basically just do a paste anywhere you want to paste your key for sending it.

like image 30
kratos Avatar answered Sep 23 '22 21:09

kratos