开发者

How to add a ssh key to connect to git?

I have a file with my DSA private key on my windows 7 computer.

How can I add this to my Macbook so I can connect to git from it? (I have my own hosting company with git on it).

I ideally want to add this to my 开发者_开发百科bash_profile also if I need to keep this alive somehow.


The private key that's on your Windows 7 computer should never leave that computer.

Create a new private/public key pair on your Mac, and add the public key to the server you want to connect to (i.e. your hosting company's server which has the git repository on it). If the server is a Linux server, you can just append the contents of the new public key file to ~/.ssh/authorized_keys on the server. For other kinds of servers, there will be some equivalent way to add the new public key, but I don't know what it would be - it depends on the server OS and possibly what SSH software it runs.


You can put the key in the <user>/.ssh directory.

If you want to generate a new key, use ssh-keygen.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜