将SSH密钥从Linux迁移到Mac [英] Migrate SSH keys from Linux to Mac
问题描述
我过去一个月一直在使用Linux,但是由于某些因素,我不得不使用Mac(OS X 10.8.3)进行进一步的工作.我已经完全设置了Linux工作站,包括SSH密钥,并且为了也允许访问Mac,我想将密钥从Linux机器复制到Mac.
I've been working with Linux for past month, however there are factors that force me to use a Mac (OS X 10.8.3) for my further work. I had my Linux station fully set up, including the SSH keys and in order to allow access for my Mac as well, I thought I'd copy the keys from my Linux machine to the Mac.
我所做的是:在Linux上压缩〜/.ssh文件夹;将档案传输到Mac;将内容提取到〜/.现在,我的Mac的〜/.ssh中有四个文件(config,xxx.pub,xxx和known_hosts).
What I did was: Compress the ~/.ssh folder on Linux; transfer the archive to the Mac; extract the contents to ~/. I now have the four files in my Mac's ~/.ssh (config, xxx.pub, xxx and known_hosts).
但是,由于我无法从bitbucket或我们的本地hg服务器克隆,因此我认为密钥无法被系统识别.您是应该以某种方式初始化密钥还是由于密钥的自定义名称,请输入某处的名字?我非常希望避免产生新密钥并将其交给我们的系统管理员的麻烦.
However I don't think the keys are recognized by the system, as I cannot clone from bitbucket or our local hg server.. Are you supposed to somehow initialize the keys or as I have custom names for my keys, enter the names somewhere? I would greatly like to avoid the trouble of generating new keys and giving them to our sysadmin.
推荐答案
原来我要做的就是
ssh-add -K ~/.ssh/name_of_the_key
也许下次它会在Google中出现更高的位置,以便其他有类似问题的人找到:)
Maybe next time it will appear higher in the google for others with a similar problem to find :)
这篇关于将SSH密钥从Linux迁移到Mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!