Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

spaceballl

macrumors 68030
Original poster
Nov 2, 2003
2,892
285
San Francisco, CA
Hi all,

So every time I google around for SSH tutorials, they always start from ground one... run ssh-keygen to generate the private / public key pair, etc etc.

However, I already have my public key on the remote system and I have the private key file on my current system. How do I "import" this key so that it loads by default.

When I boot up my mac and go into terminal, when I run
Code:
ssh-add -l
it says
The agent has no identities.

So I need to run
Code:
ssh-add my_private_key
and then if I run
Code:
ssh-add -l
, it lists my identity - how do I configure my system to load this key up by default?? Thanks!
 

cruzrojas

macrumors member
Mar 26, 2007
67
0
USA
You can modify the file .bash_profile located in your home directory and add the line

Code:
ssh-add my_private_key

at the end of the file. This will import the private key as soon as you open a terminal window.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.